First off I have to say what a great product! Autoit is easy to learn and use (reminds me of Basic days), and for simple GUI projects it is light and ideal. Great job.
I have been following the tutorials and posts on DLL calls, as this is something that would add another edge to the GUI script I have running, but I still cannot get my head around it somehow ... I have tried to understand how one could translate the data types to AutoIt format but after same days of battling I am posting here for help.
In the original Dll.h file the function is declared like this:
/** * DLLGetHidString: * Get HID object value with string format * @return 1 if no error * 0 if an error occurs */ MyDLL_DECL int MyDLLGetHidString(const char* objectName, char* sValue);
So what I have been trying is this:
Local $dll = DllOpen(MyDLL.dll) ; open DLL Local $result = DllCall($dll, "int:cdecl", "MyDLLGetHidString", "str", "StringtoQuery", "str", "value") MsgBox(0, "DLL:", "error is:" & @error & @LF &@LF & EchoArray($result)) DllClose($dll)
I get "error is:0"
the 2 x LF
then
"0" + LF
"StringtoQuery" + LF
"res"
What I don't seem to get is the actual result of my query ... the @error=0 means my call to the function was ok though ...
Any ideas and help is greatly appreciated.
Best regards
Nicdev





