lrstndm Posted July 17, 2015 Posted July 17, 2015 (edited) 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.1Architecture: X64OSBuild: 7601SP: Service Pack 1OS Type: WIN32_NTOS Verison: WIN_7Regards,lrstndm Edited July 17, 2015 by lrstndm
JohnOne Posted July 17, 2015 Posted July 17, 2015 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.
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