Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!olivea!samsung!zaphod.mps.ohio-state.edu!wuarchive!rice!uupsi!sunic!sics.se!ifi!nuug!ulrik!oivindt From: oivindt@bio.uio.no (Oivind Toien) Newsgroups: comp.lang.pascal Subject: Re: Timer in TPW Message-ID: Date: 17 Apr 91 19:41:57 GMT References: <32937@mimsy.umd.edu> Sender: news@ulrik.uio.no (USENET News System) Organization: University of Oslo, Norway Lines: 54 In-Reply-To: yogurt@mimsy.umd.edu's message of 14 Apr 91 17:37:41 GMT Nntp-Posting-Host: darwin.uio.no In article <32937@mimsy.umd.edu> yogurt@mimsy.umd.edu (Rob Crittenden) writes: > I'm having problems getting my app to recieve wm_timer callbacks. > I do a SetTimer(HWindow, 1, 1000, nil) in my Init (that's my > TObject.Init, not TApplication.Init) and have in my object: > Test.Timer(var Msg: TMessage) virtual wm_First + wm_Timer; > and the method of Timer only brings up a messagebox to say it got the > callback. The problem is, I seem to be missing all of the wm_timer > messages. 1.Well, I do not see an immediate solution (I am quite fresh windows programming). But I have the oppsosite problem: When trying to add an about window in the gdidemo.pas example, the timertick obviously checks the OK-button in the About dialog window, so that the dialog disappears after a very short time. The about procedure was added to the TGDIDemoWindow object in the following way: .... TGDIDemoWindow = object(TMDIWindow) procedure SetupWindow; virtual; procedure About(var Message: TMessage); virtual cm_First + idm_About; ....... procedure TGDIDemoWindow.About(var Message: TMessage); var Dialog: TDialog; begin Dialog.Init(@Self, 'About'); Dialog.Execute; Dialog.Done; end; ................. Does anyone have an idea what is happening, and a solution to this problem? 2. What is the resolution of this millisecond timer? Is it actually based on the DOS-timer-tick (Int $1C)? A test procedure indicated that timer-ticks could not be released more often than every 55ms although the interval was set to 1 ms. I am interested in a timer-tick with a real resolution of 1 ms to drive an A/D-convertion routine. In DOS I have reprogrammed the timer-chip and used Int $1C. Will this work under Windows, or does windows (TPW) provide a better (way of using the) timer-function? Any help will be appreciated.