Click here to Skip to main content
15,914,419 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: PowerPoint Automation Doco? Pin
Todd Hoop18-Mar-02 3:40
Todd Hoop18-Mar-02 3:40 
Generalfocus problem on win2k Pin
18-Mar-02 2:34
suss18-Mar-02 2:34 
GeneralRe: focus problem on win2k Pin
Tomasz Sowinski18-Mar-02 2:47
Tomasz Sowinski18-Mar-02 2:47 
GeneralWM_TIMER? - (semi real time) - (I'M VERY NOVICE) - (4 short questions) Pin
Joan M18-Mar-02 0:52
professionalJoan M18-Mar-02 0:52 
GeneralRe: WM_TIMER? - (semi real time) - (I'M VERY NOVICE) - (4 short questions) Pin
Tomasz Sowinski18-Mar-02 1:17
Tomasz Sowinski18-Mar-02 1:17 
GeneralRe: WM_TIMER? - (semi real time) - (I'M VERY NOVICE) - (4 short questions) Pin
Joan M18-Mar-02 4:17
professionalJoan M18-Mar-02 4:17 
GeneralRe: WM_TIMER? - (semi real time) - (I'M VERY NOVICE) - (4 short questions) Pin
Tomasz Sowinski18-Mar-02 4:36
Tomasz Sowinski18-Mar-02 4:36 
GeneralRe: WM_TIMER? - (semi real time) - (I'M VERY NOVICE) - (4 short questions) Pin
C-J Berg18-Mar-02 1:58
C-J Berg18-Mar-02 1:58 
1) Nothing could happen, besides that the update would occur less frequently. However, I believe 10 ms is too frequent if the update is made only for updating a GUI. It could probably be 250 ms (a quarter of a second), or even higher.

2/3/4) Using a WM_TIMER message to pull information is an old fashion, "16-bit" type solution, which, as you've noticed, usually affects performance. While it is possible to discard intermediate messages that have arrived during processing of another (by using the message filtering parameters of PeekMessage to remove such messages), it would be better to implement a push design in the DLL.

If you have the DLL's source code, you could change it to signal a kernel object (such as an event) as soon as new information is available. The event would typically be created by the consumer application, and be supplied to the DLL through some initialization function. The application would then wait on this object to become signaled, either in a separate worker thread (the better choice since it wouldn't lock up the GUI during update processing), or in its main thread by using MsgWaitForMultipleObjects (in order to allow for window message processing).

When signaled, the application should do whatever needs to be done for retrieving data from the DLL and updating the user interface, then return and wait for another update to occur. This way, the update thread will only be active when new data is available (which could be after 5 ms or 15 minutes).

If you need to limit the update interval (i.e., data is sometimes available more often than you'd like to update the GUI), you could create a WaitableTimer object with say a 50 ms interval, and let the thread wait for both the update event and the timer object to become signaled (WaitForMultipleObjects with bWaitAll = TRUE). This way the update cannot begin until the wait interval has expired even if data is available.

Good luck!

GeneralRe: WM_TIMER? - (semi real time) - (I'M VERY NOVICE) - (4 short questions) Pin
Joan M18-Mar-02 5:36
professionalJoan M18-Mar-02 5:36 
GeneralRe: WM_TIMER? - (semi real time) - (I'M VERY NOVICE) - (4 short questions) Pin
C-J Berg18-Mar-02 6:38
C-J Berg18-Mar-02 6:38 
GeneralRe: WM_TIMER? - (semi real time) - (I'M VERY NOVICE) - (4 short questions) Pin
Tomasz Sowinski18-Mar-02 7:17
Tomasz Sowinski18-Mar-02 7:17 
GeneralRe: WM_TIMER? - (semi real time) - (I'M VERY NOVICE) - (4 short questions) Pin
C-J Berg19-Mar-02 1:56
C-J Berg19-Mar-02 1:56 
GeneralRe: WM_TIMER? - (semi real time) - (I'M VERY NOVICE) - (4 short questions) Pin
Tomasz Sowinski19-Mar-02 2:08
Tomasz Sowinski19-Mar-02 2:08 
GeneralRe: WM_TIMER? - (semi real time) - (I'M VERY NOVICE) - (4 short questions) Pin
C-J Berg19-Mar-02 2:37
C-J Berg19-Mar-02 2:37 
GeneralRe: WM_TIMER? - (semi real time) - (I'M VERY NOVICE) - (4 short questions) Pin
Joan M19-Mar-02 23:20
professionalJoan M19-Mar-02 23:20 
GeneralRe: WM_TIMER? - (semi real time) - (I'M VERY NOVICE) - (4 short questions) Pin
JT Anderson18-Mar-02 8:14
JT Anderson18-Mar-02 8:14 
GeneralRegistry Operations Pin
udayakumar18-Mar-02 0:38
udayakumar18-Mar-02 0:38 
GeneralRe: Registry Operations Pin
Tomasz Sowinski18-Mar-02 0:43
Tomasz Sowinski18-Mar-02 0:43 
GeneralRe: Registry Operations Pin
Abhishek Narula18-Mar-02 0:52
Abhishek Narula18-Mar-02 0:52 
GeneralRe: Registry Operations Pin
Abhishek Narula18-Mar-02 1:05
Abhishek Narula18-Mar-02 1:05 
GeneralRe: Registry Operations Pin
udayakumar18-Mar-02 1:38
udayakumar18-Mar-02 1:38 
GeneralDisable audio port Pin
Halid Niyaz18-Mar-02 0:04
Halid Niyaz18-Mar-02 0:04 
GeneralMultiple View Application Pin
Abhishek Narula17-Mar-02 23:40
Abhishek Narula17-Mar-02 23:40 
GeneralRe: Multiple View Application Pin
Tomasz Sowinski18-Mar-02 0:24
Tomasz Sowinski18-Mar-02 0:24 
GeneralRe: Multiple View Application Pin
Abhishek Narula18-Mar-02 0:32
Abhishek Narula18-Mar-02 0:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.