bile Posted November 17, 2010 Posted November 17, 2010 #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include "biledde\DDEML.au3" #include "biledde\DDEMLClient.au3" #include <SQLite.au3> #include <SQLite.dll.au3> #Include <Timers.au3> #include <Math.au3> Opt("GUIonEventMode",1) opt("GUIEventOptions",0) AutoItSetOption("MustDeclareVars",1) Global $main,$timer $main=GUICreate("Test Timer",500,400,-1,-1,$WS_SIZEBOX) $timer=_Timer_SetTimer($main,1000,"timeout") GUISetState() while 1 sleep(2000) wend Func timeout() consolewrite("timeout!!!!!!!!!!!!!!!!!!!!!!!!") EndFunc Hello, I have a problem with my script using _Timer_setTimer every time the timer elapses, I get an "Error Allocating Memory" and the script crashes. As My script works fine without the timer, I tried to use it in a simple script, but I get the same result. What's wrong with it?? Could someone please help ?
KaFu Posted November 17, 2010 Posted November 17, 2010 Function parameters and #forceref has to be added. But with the enhancement to use more then one AdlibRegister() I would switch to that. #include <WindowsConstants.au3> #include <Timers.au3> $main = GUICreate("Test Timer", 500, 400, -1, -1, $WS_SIZEBOX) $timer = _Timer_SetTimer($main, 1000, "timeout") GUISetState() While 1 Sleep(2000) WEnd Func timeout($hWnd, $Msg, $iIDTimer, $dwTime) #forceref $hWnd, $Msg, $iIDTimer, $dwTime ConsoleWrite("timeout!!!!!!!!!!!!!!!!!!!!!!!!" & @crlf) EndFunc ;==>timeout OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16)
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