prozario Posted August 15, 2007 Share Posted August 15, 2007 I'm trying to use the DllCall() to call a function ("GetString" - see code below) in a test DLL I created in C#. I tested this DLL using a C# test stub which works; no problem whatsoever. When I tried the code below, it returns @error = 3 - "function" not found in the DLL file. What wrong with this code? I've been fighting with this for several hours. Much thanks in advanced. ~Phil ; Test DllCall $dll = DllOpen("C:\SQA\Examples\MyDll.dll") $result = DllCall($dll, "str", "GetString") if @error <> 0 Then ConsoleWrite("Error " & @error & " " & $result & @CRLF) DllClose($dll) exit EndIf MsgBox(0, "DLL Test", $result[0]) Sleep(10000) DllClose($dll) Link to comment Share on other sites More sharing options...
Zedna Posted August 15, 2007 Share Posted August 15, 2007 Use dumpbin utility to see real names inside your DLLRun:DUMPBIN.EXE /exports MyDll.dll Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
prozario Posted August 15, 2007 Author Share Posted August 15, 2007 Much appreciated. I'll check it out. Thanks. ~Phil Link to comment Share on other sites More sharing options...
Zedna Posted August 15, 2007 Share Posted August 15, 2007 Also look here Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
martin Posted August 16, 2007 Share Posted August 16, 2007 I'm trying to use the DllCall() to call a function ("GetString" - see code below) in a test DLL I created in C#. I tested this DLL using a C# test stub which works; no problem whatsoever. When I tried the code below, it returns @error = 3 - "function" not found in the DLL file. What wrong with this code? I've been fighting with this for several hours. Much thanks in advanced. ~Phil ; Test DllCall $dll = DllOpen("C:\SQA\Examples\MyDll.dll") $result = DllCall($dll, "str", "GetString") if @error <> 0 Then ConsoleWrite("Error " & @error & " " & $result & @CRLF) DllClose($dll) exit EndIf MsgBox(0, "DLL Test", $result[0]) Sleep(10000) DllClose($dll) If the dll worked with your C test program then maybe you just need to do this in AutoIt $result = DllCall($dll, "str:cdecl", "GetString") Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. 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