Jump to content

DLLCall returns AutoIt3.exe error


Recommended Posts

I just started using DLL functions in autoit and I found a short tutorial about DLL calling. ( https://www.autoitscript.com/forum/topic/93496-tutorial-on-dllcall-dllstructs/ )

I just copied some code form the examples he gave me. But when I run the code below my SciTe Editor runs for about 10 seconds and then crashes with error code:

!>11:31:16 AutoIt3.exe ended.rc:-1073741819
$SYSTEMTIME=DllStructCreate("ushort wYear;ushort wMonth;ushort wDayOfWeek;ushortwDay;ushort wHour;ushort wMinute;ushort wSecond;ushort wMilliseconds")
DllCall("Kernel32.dll","none","GetSystemTime","ptr",DllStructGetPtr($SYSTEMTIME))
MsgBox(0,"Currenttime:",DllStructGetData($SYSTEMTIME,"wHour")&":"&DllStructGetData($SYSTEMTIME,"wMinute"))

Is there something wrong with the code? Or is it a bug in the SciTe Editor?
I also read something about the "cdecl" calling method. Has this something to do with it? When do I need to use it? And how can I know this when to use?

Also some information about my SciTe version etc.

SciTe version: 3.4.1
Architecture: X64
OSBuild: 7601
SP: Service Pack 1
OS Type: WIN32_NT
OS Verison: WIN_7

Regards,

lrstndm

Edited by lrstndm
Link to comment
Share on other sites

Looks like a typo.

$SYSTEMTIME=DllStructCreate("ushort wYear;ushort wMonth;ushort wDayOfWeek;ushort wDay;ushort wHour;ushort wMinute;ushort wSecond;ushort wMilliseconds")
DllCall("Kernel32.dll","none","GetSystemTime","ptr",DllStructGetPtr($SYSTEMTIME))
MsgBox(0,"Currenttime:",DllStructGetData($SYSTEMTIME,"wHour")&":"&DllStructGetData($SYSTEMTIME,"wMinute"))

 

Note: ushort wDay

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

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

×
×
  • Create New...