Click here to Skip to main content
15,916,398 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Hourglass Animation? Pin
David Crow8-Sep-04 8:40
David Crow8-Sep-04 8:40 
AnswerRe: Hourglass Animation? Pin
Graham Bradshaw8-Sep-04 13:00
Graham Bradshaw8-Sep-04 13:00 
GeneralI've shown the dialog, now I can't interact with it. Pin
BlackDice8-Sep-04 6:16
BlackDice8-Sep-04 6:16 
GeneralWM_HSCROLL doesn't work on custom sliders Pin
Budric B.8-Sep-04 6:05
Budric B.8-Sep-04 6:05 
GeneralRe: WM_HSCROLL doesn't work on custom sliders Pin
Anonymous8-Sep-04 6:44
Anonymous8-Sep-04 6:44 
GeneralADO, Winsock, Client/Server Pin
Kudakwashe Mafutah8-Sep-04 5:58
Kudakwashe Mafutah8-Sep-04 5:58 
QuestionHow can I show a dialog on top of a screensaver? Pin
BlackDice8-Sep-04 4:20
BlackDice8-Sep-04 4:20 
GeneralSingle thread to multi-thread conversion problem Pin
vineas8-Sep-04 4:02
vineas8-Sep-04 4:02 
I'm in the process of adding a separate thread for a certain type of processing done in an app which deals with very large files (sometimes more than 1GB), and can take several minutes. The app has been an ongoing project for the last several years, should have been done as a multi-threaded app to begin with, but I'm coming in a bit too late to think about that Sigh | :sigh:

Anyway, with a ton of help from searching around the message board here (thanks!) I've spawned the processing off to a different messaging thread, which has two messages it can respond to UWM_START and UWM_STOP. While processing, it responds back to the main thread with UWM_UPDATE_PROGRESS and then UWM_DONE_PROCESSING when finished. For the most part this works well. UWM_START kicks off the long processing and it periodically has a message pump loop it does so that if UWM_STOP is sent it can respond to it. This part is working well, but I'm having a problem with code that is shared between this thread and the main thread.

The part that is spawned off shares A LOT of code with the rest of the project, the shared code contains many message pumping loops (which are needed because of the fact it was done as single threaded to begin with). When I comment out thoes message pump loops (and leave the one in the processing thread), everything works great. However, if those message pump loops are in there, then I get a couple of weird errors. This doesn't really make sense though, since the documention of the message functions indicate it's done on a thread-by-thread basis, so I shouldn't be messing any of the messages up. ... and why would one pump be ok, and more cause problems?

My question is, are these extra message pump loops causing me problems, or are they just helping uncover some larger flaw with all the shared code?

BTW, the message pump loops are implemented as suggested in many places on the board:
MSG msg;<br />
while(::PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE)<br />
    AfxGetThread()->PumpMessage();


-----
In the land of the blind the one eyed man is king.
GeneralRe: Single thread to multi-thread conversion problem Pin
Neville Franks8-Sep-04 10:32
Neville Franks8-Sep-04 10:32 
GeneralRe: Single thread to multi-thread conversion problem Pin
vineas8-Sep-04 11:10
vineas8-Sep-04 11:10 
GeneralRe: Single thread to multi-thread conversion problem Pin
Neville Franks8-Sep-04 11:28
Neville Franks8-Sep-04 11:28 
GeneralRe: Single thread to multi-thread conversion problem Pin
vineas9-Sep-04 3:29
vineas9-Sep-04 3:29 
GeneralRe: Single thread to multi-thread conversion problem Pin
Neville Franks9-Sep-04 10:23
Neville Franks9-Sep-04 10:23 
GeneralPhilosophical question :-) Pin
Cedric Moonen8-Sep-04 3:35
Cedric Moonen8-Sep-04 3:35 
GeneralRe: Philosophical question :-) Pin
Ryan Binns8-Sep-04 4:07
Ryan Binns8-Sep-04 4:07 
GeneralRe: Philosophical question :-) Pin
Cedric Moonen8-Sep-04 4:31
Cedric Moonen8-Sep-04 4:31 
GeneralRe: Philosophical question :-) Pin
Ryan Binns8-Sep-04 13:24
Ryan Binns8-Sep-04 13:24 
GeneralDetect current language Pin
Anonymous8-Sep-04 3:33
Anonymous8-Sep-04 3:33 
GeneralRe: Detect current language Pin
Ivan Cachicatari8-Sep-04 5:43
Ivan Cachicatari8-Sep-04 5:43 
GeneralRe: Detect current language Pin
David Crow8-Sep-04 5:47
David Crow8-Sep-04 5:47 
GeneralRe: Detect current language Pin
Moak24-Sep-04 1:33
Moak24-Sep-04 1:33 
Generalabout using vmr9 Pin
yingkou8-Sep-04 3:29
yingkou8-Sep-04 3:29 
QuestionHow can I push out my app Pin
Larsson8-Sep-04 2:18
Larsson8-Sep-04 2:18 
Generalconvert bmp to 2-D array Pin
hanivoo8-Sep-04 1:49
hanivoo8-Sep-04 1:49 
GeneralRe: convert bmp to 2-D array Pin
Bob Stanneveld8-Sep-04 6:29
Bob Stanneveld8-Sep-04 6:29 

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.