JustANoob Posted July 26, 2007 Share Posted July 26, 2007 Hi all, iam trying to call a dll using the method OpenDLL and DllCall and here how i call in VB.Net: #how I import lib <DllImport("MYDLL.DLL")> Public Shared Sub SR(ByVal Width As Integer, ByVal Height As Integer) #some part of my code in VB.NET Dim num As Integer Dim height As Integer = num = 0 If Me.rbRes1.Checked Then num = 640 height = 480 ElseIf Me.rbRes2.Checked Then num = 800 height = 600 ElseIf Me.rbRes3.Checked Then num = &H400 height = &H300 Else num = &H500 height = &H400 End If Imports.SR(num, height) Now iam trying to call same function in AU3: $dll = dllopen("C:mydll.dll") DllCall ($dll, "none", "SR" , "1024", "768") OR $dll = dllopen("C:mydll.dll") DllCall ($dll, "none", "SR" , 1024, 768) OR $dll = dllopen("C:mydll.dll") DllCall ($dll, "none", "SR" , HEX(1024), HEX(768)) In vb.net works fine, but in AU3, even I call with 1024, 768 the function works in 640, 480. Any idea? PS: I need use OpenDLL couse the function still running and rezise window when press hotkey. Thanks. Link to comment Share on other sites More sharing options...
JustANoob Posted July 26, 2007 Author Share Posted July 26, 2007 well, here is the function on the DLL: (C++) HOOKDLL_API VOID SR(INT Width,INT Height) { g_XRES = Width; g_YRES = Height; } How i call function now: $return = DllCall ($dll , "ptr", "SR", "int", 1024, "int", 768) OR $return = DllCall ($dll , "none", "SR", "int", 1024, "int", 768) And it just dont works =\ Link to comment Share on other sites More sharing options...
JustANoob Posted July 26, 2007 Author Share Posted July 26, 2007 o.O Nobody knows if is an bug or anything else? Have another way to call this function? Link to comment Share on other sites More sharing options...
piccaso Posted July 26, 2007 Share Posted July 26, 2007 did you check @error ? CoProc Multi Process Helper libraryTrashBin.nfshost.com store your AutoIt related files here!AutoIt User Map Link to comment Share on other sites More sharing options...
JustANoob Posted July 26, 2007 Author Share Posted July 26, 2007 If @error Then _GetLastErrorMessage ("DllCall() error") Yes =\ Have no error, just dont works. I can use ANY argument (like "aks", "jdja") and just return like 640,480. I call it in VB.net and works fine.... T_T Link to comment Share on other sites More sharing options...
piccaso Posted July 26, 2007 Share Posted July 26, 2007 post it (the dll or the source, preferably both) CoProc Multi Process Helper libraryTrashBin.nfshost.com store your AutoIt related files here!AutoIt User Map Link to comment Share on other sites More sharing options...
JustANoob Posted July 26, 2007 Author Share Posted July 26, 2007 Here is the source of the dll C++:http://www.autoitscript.com/forum/index.ph...st&id=13552Also, a souce of the exe who call the dll (in C++ too).The source in VB.NET is in my other pc. I want call the dll in my script, but it just dont work... Link to comment Share on other sites More sharing options...
piccaso Posted July 26, 2007 Share Posted July 26, 2007 try this: DllCall ($dll , "none:cdecl", "SR", "int", 1024, "int", 768) CoProc Multi Process Helper libraryTrashBin.nfshost.com store your AutoIt related files here!AutoIt User Map Link to comment Share on other sites More sharing options...
JustANoob Posted July 26, 2007 Author Share Posted July 26, 2007 try this: DllCall ($dll , "none:cdecl", "SR", "int", 1024, "int", 768) $return = DllCall ($dll , "none:cdecl", "SR", "int", 1024, "int", 768) DllCall ($dll, "none:cdecl", "IH") Now its works. I try before, but I was using ":cdecl" only on the first function. Thanks for help, I will test in my main script later (i hope it works, couse have almost 20.000 lines and if i got some error T_T). Thanks Piccaso, if u need something just pm (lol... i dont think i can help u couse iam a little noob in auto it). Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now