Jump to content

DllCall


prozario
 Share

Recommended Posts

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...