ozymandius257 Posted June 22, 2022 Share Posted June 22, 2022 I have a DLL which returns a tuple value (boolean, string). I tried using the following: $Result = DllCall("mydll.dll", "BOOLEAN:STR", "Check_if_running") but I get back @error = 2 (unknown return type) If I change the return type to just BOOLEAN, I then get @error = 3 (function not found in the DLL) I'm trying to do this as I have written a program using the DLL in VB.Net, but I'm wondering if the same program in AutoIt would produce an exe which would have a smaller memory usage, as the program has to run 24 hours a day on machines with limited memory. Back up my hard drive? - I can't even find reverse gear. Link to comment Share on other sites More sharing options...
Danp2 Posted June 22, 2022 Share Posted June 22, 2022 I'm guessing that you would need to use type STRUCT. See the 3rd example for DllCall in the help file. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Danyfirex Posted June 22, 2022 Share Posted June 22, 2022 Hello, show your dll function declaration information. Saludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
ozymandius257 Posted July 11, 2022 Author Share Posted July 11, 2022 Hi, sorry for the long delay - been away. Anyway, still no success, so I wrote a simple function in my dll which just returns a string, but I'm still getting @error returned as 3 - "function not found in the DLL file". I know the function is there, as I wrote the DLL in VB.net, so here's my autoit code... Local $Returned = DllCall("c:\mydll.dll", "STR", "Test", "STR", "Test") if @error <> 0 Then MsgBox(0, "Error", @error) Else MsgBox (0, "", $Returned[0]) EndIf And the dll function is this: Public Function Test(strInput As String) As String Return "The input string was " & strInput End Function The only thing I can think of is that the function is in a class inside the DLL, so if the class is called 'TestFunctions', how would I pass that in the DLLCall? - I've tried DllCall("c:\mydll.dll", "STR", "TestFunctions/Test", "STR", "Test") DllCall("c:\mydll.dll", "STR", "TestFunctions\Test", "STR", "Test") DllCall("c:\mydll.dll", "STR", "TestFunctions:Test", "STR", "Test") DllCall("c:\mydll.dll", "STR", "TestFunctions.Test", "STR", "Test") with no joy 😕 Back up my hard drive? - I can't even find reverse gear. Link to comment Share on other sites More sharing options...
Solution Danp2 Posted July 11, 2022 Solution Share Posted July 11, 2022 2 hours ago, ozymandius257 said: I know the function is there, as I wrote the DLL in VB.net See this post for an explanation of why the function can't be found. pixelsearch 1 Latest Webdriver UDF Release Webdriver Wiki FAQs 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