PDA

View Full Version : Timer in DLL



NecroDOME
11-10-2006, 04:00 PM
Im trying to create a timer within a DLL.


procedure TEngineTimer.Init;
begin
OnTimer := OnTimerRun;
MaxFPS := 1000;
Enabled := True;

ShowMessage('Timer');
end;


Problem: When the ShowMessage is visible the timer runs. When I remove the ShowMessage the timer doens't do anything.
Is this a problem with threads or something?

(Im using OmegaTimer)

NecroDOME
16-10-2006, 01:49 PM
Anyone?

WILL
16-10-2006, 02:44 PM
I think you need to have something that they run themselves in their own code. A call to the function to increment the internal value. I know of no known internally running function from a DLL. :?

Maybe have them place a Necro_Timer; function within their main game loop? Then you can give them Necro_Timer_Start(); and Necro_TimerStop; to manually start and stop the clock.

Or am I not understanding the method of which you're using the timer?

NecroDOME
16-10-2006, 02:53 PM
I could try that. I once created a timer (the default TTimer from delphi) in a dll for a chatterbot. But the omega timer doens't whan't to be placed within a DLL...