Solved

timeSetEvent Error..

Posted on 2003-11-10
3
1,059 Views
Last Modified: 2007-12-19

Platform : Win2K Pro/SP4,  VC7/WinMM

Hi All,
       I need some hi-resolution timers. (ranging 10ms to 25 ms). I know Windows may not be be able to maintain that resolution, but I can manage that. But the real problem is sometimes I get an error when calling timeSetEvent() function (Time ID NULL). I went thru MSDN real quick and I could not find any method to see the reason why it failed.

This is what I do.
        I have several streaming data channels (UDP).
        Every channel has a timer object for data dispatch.
        These channels could stop start timers at any time (normally they just keep running).
        I call timeSetEvent() on every channel object at beginning. (timer resolution 23 ms for testing)
        It works fine for ~20 channels.
        The rest fails on tiemSetEvent()

        I checked timeCaps. (min resolution 1ms)

Any idea whats wrong ?? Is there a limitation for timesetEvent() ???

~ J
0
Comment
Question by:mxjijo
3 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 125 total points
ID: 9716449
Yes, there is a limitation - see http://support.microsoft.com/default.aspx?scid=kb;EN-US;140104 ("HOWTO: Availability of Multimedia Timers"):

The number of multimedia timers your application can create at one time can vary based on the operating system it is running on and whether the application is 16-bit or 32-bit.

The following table gives an indication of what you can expect:

Operating System      16-bit app   32-bit app
--------------------------------------------------------------
Windows 3.11               8           0 (Not supported on Win32s)
Windows 95                32          32
Windows 98                32          32
Windows NT 3.51           16          16 per process
Windows NT 4.0            16          16 per process
Windows 2000              16          16 per process

0
 
LVL 8

Author Comment

by:mxjijo
ID: 9716473

What the.. !!!

thank u jkr :)
0
 

Expert Comment

by:twinstarjoe
ID: 14470625
What is this limit in Windows XP ?
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now