Share this post

Link to post

Share on other sites

Zedna 193

Zedna 193

If@errorThen_GetLastErrorMessage ("DllCall() error");===============================================; _GetLastErrorMessage($DisplayMsgBox=""); Format the last windows error as a string and return it; if $DisplayMsgBox <> "" Then it will display a message box w/ the error; Return Window's error as a string;===============================================Func_GetLastErrorMessage ($DisplayMsgBox="")Local$ret,$sLocal$p=DllStructCreate("char[4096]")LocalConst$FORMAT_MESSAGE_FROM_SYSTEM=0x00001000If@errorThenReturn""$ret=DllCall("Kernel32.dll","int","GetLastError")$ret=DllCall("kernel32.dll","int","FormatMessage",_"int",$FORMAT_MESSAGE_FROM_SYSTEM,_"ptr",0,_"int",$ret[0],_"int",0,_"ptr",DllStructGetPtr($p),_"int",4096,_"ptr",0)$s=DllStructGetData($p,1)$p=0If$DisplayMsgBox<>""ThenMsgBox(0,"_GetLastErrorMessage",$DisplayMsgBox&@CRLF&$s)Return$sEndFunc;==>_GetLastErrorMessage

Share this post

Link to post

Share on other sites

cojms1 0

cojms1 0

Have added the code but @error is not being set. There is no error being returned by the DLLCall() function. The call all seems to go fine. My problem is that it seems to only populate the 1st element in the structure. All other elements return 0.

Share this post

Link to post

Share on other sites

Zedna 193

Zedna 193

Have added the code but @error is not being set. There is no error being returned by the DLLCall() function. The call all seems to go fine. My problem is that it seems to only populate the 1st element in the structure. All other elements return 0.

Share this post

Link to post

Share on other sites

Lemonsun 0

Lemonsun 0

If@errorThen_GetLastErrorMessage ("DllCall() error");===============================================; _GetLastErrorMessage($DisplayMsgBox=""); Format the last windows error as a string and return it; if $DisplayMsgBox <> "" Then it will display a message box w/ the error; Return Window's error as a string;===============================================Func_GetLastErrorMessage ($DisplayMsgBox="")Local$ret,$sLocal$p=DllStructCreate("char[4096]")LocalConst$FORMAT_MESSAGE_FROM_SYSTEM=0x00001000If@errorThenReturn""$ret=DllCall("Kernel32.dll","int","GetLastError")$ret=DllCall("kernel32.dll","int","FormatMessage",_"int",$FORMAT_MESSAGE_FROM_SYSTEM,_"ptr",0,_"int",$ret[0],_"int",0,_"ptr",DllStructGetPtr($p),_"int",4096,_"ptr",0)$s=DllStructGetData($p,1)$p=0If$DisplayMsgBox<>""ThenMsgBox(0,"_GetLastErrorMessage",$DisplayMsgBox&@CRLF&$s)Return$sEndFunc;==>_GetLastErrorMessage

Is there anyone who worked with delphi and show me hints to execute my dll with Autoit ?

Nothing worked ! and not getting error evnthough i run Then _GetLastErrorMessage Procedure !

Share this post

Link to post

Share on other sites

sidkipper 0

sidkipper 0

Spent a while scratching my head on this too. Problem is that NetRemoteTOD does not populate the structure you supply a pointer to, with the TIME_OF_DAY_INFO data you're expecting. It populates this with a pointer to the data that you're expecting. Hence why only the first element of the structure appears to be populated (its populated with the pointer rather than actual TOD data)...

You need to create a structure receive the pointer into, then use that in DllStructCreate to form the structure around the memory with the useful data in...