Tagged Questions
10
votes
5answers
2k views
How is Win32 event-driven programming implemented under the hood?
In a Win32 C++ application, we start a message loop that fetches messages from a queue, translates them and then dispatches them. Eventually, each message reaches our WndProc where the associated ...
6
votes
1answer
805 views
What explains this strange PeekMessage behaviour (trying to deal with a full message queue, filtering for specific messages)?
Our application acts as a COM server where all automation occurs within a single STA apartment (in the application's main thread), and some VBS scripts which make lengthy (>10 minute) calls are ...
5
votes
10answers
907 views
More threads, better performance?
When I write a message driven app. much like a standard windows app only that it extensively uses messaging for internal operations, what would be the best approach regarding to threading?
As I see ...
5
votes
1answer
2k views
Busy Application leads to false “Not responding” state on Windows 7 - WM_UPDATE
During long term operations our C++ Win32 application shows a modal status dialog with a process bar, which is updated irregular every few seconds or so. Starting with Windows 7 we realized that ...
5
votes
1answer
1k views
Can I monitor the size of a thread's message queue?
Our application is getting a System Call Failed RPC error from DCOM (0x80010100), we suspect that the target thread's message queue is full (although I'm not convinced this is ture). I know the queue ...
3
votes
11answers
2k views
Windows Game Loop 50% CPU on Dual Core
The game loop alone is using 50% of CPU Usage, I haven't done any rendering work yet. What I'm doing here?
while(true)
{
if(PeekMessage(&msg,NULL,0,0,PM_REMOVE))
...
3
votes
4answers
817 views
Win32 Message Handler Error Propagation
I'm writing a (C++) application that utilizes a single dialog box.
After setting up a message pump and handler I started wondering how I would go about propagating C++ exceptions to my original code ...
2
votes
1answer
408 views
Determine priority of a window message
Is there any way to programmatically check the priority of a window messages in its message queue?
For example: Some of window messages, WM_PAINT and WM_TIMER are known have the lowest priority and ...
2
votes
4answers
2k views
Message queuing solutions?
(Edited to try to explain better)
We have an agent, written in C++ for Win32. It needs to periodically post information to a server. It must support disconnected operation. That is: the client ...
2
votes
1answer
271 views
Does WaitForMultipleObjects cause problems in a thread creating STA COM objects?
I have a thread which creates COM objects that use the STA model.
This thread's Run function puts it in an infinite WaitForMultipleObjects.
Is it possible that the infinite WaitForMultipleObjects ...
2
votes
1answer
676 views
multithreading: event driven vs message driven
Is there a difference in performance when multi-threading developed with win32 event objects (CreateEvent) or with thread window message queue. Both should use some kind of WaitFor... calls.
My own ...
2
votes
3answers
1k views
Win32: IProgressDialog will not disappear until you mouse over it
i'm using the Win32 progress dialog. The damnest thing is that when i call:
progressDialog.StopProgressDialog();
it doesn't disappear. It stays on screen until the user moves her mouse over it - ...
1
vote
3answers
594 views
Processing messages is too slow, resulting in a jerky, unresponsive UI - how can I use multiple threads to alleviate this?
I'm having trouble keeping my app responsive to user actions. Therefore, I'd like to split message processing between multiple threads.
Can I simply create several threads, reading from the same ...
1
vote
4answers
990 views
How to find out if a thread has message queue?
Is there any way to find out from threadId , if a thread has message queue or not?
Basically there are some windows api which only work if a thread has message queue.window
1
vote
4answers
137 views
How to pass data(structure) as a message to a thread.
How do I pass data to a thread from main application?
Inside the main application I created a thread for processing error messages. While processing data in the main application if there is an error, ...