Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Delphi 6 TimeSetEvent Problem
Hello,

I am trying to help a friend understand a problem he is having with the Time
SetEvent function in Delphi 6.

Microsoft defines  timeSetEven like so:

MMRESULT timeSetEvent(UINT uDelay, UINT uResolution, LPTIMECALLBACK lpTimePr
oc, DWORD dwUser, UINT fuEvent);

Arguments:
uDelay - Event delay, in milliseconds. Pretty much the same as uElapse in Se
tTimer.
uResolution - Resolution of the timer event, in milliseconds.
lpTimeProc - Pointer to the callback function that we want to be called peri
odically.
dwUser - User data passed to the callback function.
fuEvent - Timer event type. May be either TIME_ONESHOT, in which case the ca
llback function is called only once, or TIME_PERIODIC for
periodic calling.

My friend says that he can not use a value greater than 999000 milliseconds 
for uDelay or the function dies.  He has tried many
values for uResolution, but all with the same results.

To get around the 999000 milliseconds limit, he has put a sleep call in the 
callback function dwUser to put the process to sleep for
the amount of time he needs timeSetEvent to actually run.

Has anyone ever run into a limit on the number of milliseconds that can be f
ed into timeSetEvent?  If not, then what could possibly
cause the limitation that we are experiencing?

I can furnish the problematic code if necessary.

Thank you,

Murrah

Report this thread to moderator Post Follow-up to this message
Old Post
WA Support
04-01-05 01:58 AM


Re: Delphi 6 TimeSetEvent Problem
WA Support wrote:
> Hello,
>
> I am trying to help a friend understand a problem he is having with the Ti
meSetEvent function in Delphi 6.
>
> Microsoft defines  timeSetEven like so:
>
> MMRESULT timeSetEvent(UINT uDelay, UINT uResolution, LPTIMECALLBACK lpTime
Proc, DWORD dwUser, UINT fuEvent);
>
> Arguments:
> uDelay - Event delay, in milliseconds. Pretty much the same as uElapse in 
SetTimer.
> uResolution - Resolution of the timer event, in milliseconds.
> lpTimeProc - Pointer to the callback function that we want to be called pe
riodically.
> dwUser - User data passed to the callback function.
> fuEvent - Timer event type. May be either TIME_ONESHOT, in which case the 
callback function is called only once, or TIME_PERIODIC for
> periodic calling.
>
> My friend says that he can not use a value greater than 999000 millisecond
s for uDelay or the function dies.  He has tried many
> values for uResolution, but all with the same results.
>
> To get around the 999000 milliseconds limit, he has put a sleep call in th
e callback function dwUser to put the process to sleep for
> the amount of time he needs timeSetEvent to actually run.
>
> Has anyone ever run into a limit on the number of milliseconds that can be
 fed into timeSetEvent?  If not, then what could possibly
> cause the limitation that we are experiencing?
>
> I can furnish the problematic code if necessary.
>
> Thank you,
>
> Murrah
Strange, AT MSDN it states that its only supported in XP how ever, i
find it in older Help files and states that its supported on all.
oh well.
Hmm
so 16.5 mins is the min, why would some one want a multimedia timer any
longer than that ?

from the help
uDelay
"
Event delay, in milliseconds. If this value is not in the range of the
minimum and maximum event delays supported by the timer, the function
returns an error."

one needs to reference the "TimeGetDevCaps" to get the min and max
range of the current driver for the sound card.
etc..
you may want to think about using a Ttimer for long hauls.








Report this thread to moderator Post Follow-up to this message
Old Post
Jamie
04-01-05 09:00 PM


Re: Delphi 6 TimeSetEvent Problem
"WA Support" <support@wildapache.net> wrote in message
news:424c5a81.3291086392@news.wildapache.net...
> Hello,
>
> I am trying to help a friend understand a problem he is having with the
TimeSetEvent function in >Delphi 6.

> To get around the 999000 milliseconds limit, he has put a sleep call in
the callback function dwUser to put the process to sleep for
> the amount of time he needs timeSetEvent to actually run.

settimer, ttimer, sleep
if it must be very accurate, sleep then wake up and poll or schedule timer
for the last few milliseconds.

> Has anyone ever run into a limit on the number of milliseconds that can be
fed into timeSetEvent?  If not, then what could possibly
> cause the limitation that we are experiencing?

Multimedia timers are very accurate, there are low limits on the number
available.
Using it for more such long delays is inappropriate.





Report this thread to moderator Post Follow-up to this message
Old Post
Terry Russell
04-06-05 05:23 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Delphi archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 06:58 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.