prozario 0 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) Share this post Link to post Share on other sites
Zedna 294 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 Share this post Link to post Share on other sites
prozario 0 Posted August 15, 2007 Much appreciated. I'll check it out. Thanks. ~Phil Share this post Link to post Share on other sites
Zedna 294 Posted August 15, 2007 Also look here Resources UDF ResourcesEx UDF AutoIt Forum Search Share this post Link to post Share on other sites
martin 85 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. Share this post Link to post Share on other sites