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

C / C++ / MFC

 
GeneralRe: Status Bar Help Required Pin
vividtang13-May-04 15:41
vividtang13-May-04 15:41 
GeneralC++ Exception Handling Pin
IceBerG7112-May-04 5:41
IceBerG7112-May-04 5:41 
GeneralRe: C++ Exception Handling Pin
David Crow12-May-04 6:36
David Crow12-May-04 6:36 
GeneralRe: C++ Exception Handling Pin
IceBerG7112-May-04 15:30
IceBerG7112-May-04 15:30 
GeneralRe: C++ Exception Handling Pin
Joe Woodbury12-May-04 7:08
professionalJoe Woodbury12-May-04 7:08 
GeneralRe: C++ Exception Handling Pin
Paul Ranson12-May-04 13:11
Paul Ranson12-May-04 13:11 
GeneralEvents and Shared Memory Pin
sweep12312-May-04 4:57
sweep12312-May-04 4:57 
GeneralRe: Events and Shared Memory Pin
Joe Woodbury12-May-04 6:58
professionalJoe Woodbury12-May-04 6:58 
Global events and shared memory have no relationship, apart from using the global namespace, etc..

You scheme is fundamentally valid, though, as you stated, you may want to add a mutex so the shared memory can be locked.

I don't like how you pass the pointer of the dlg into the thread; it seems awfully convoluted. Why not just pass the this pointer as the param?

The second potential problem is pxDlg->UpdateOutput(). This is the most likely candidate for a memory overwrite of your m_pMsg pointer. (The shared memory is very likely still there, (Verify with this utility: http://www.sysinternals.com/ntw2k/freeware/procexp.shtml[^])

A few other concern: You may be handling CTestGUI1Dlg incorrectly. You should use PostThreadMessage to do more than trivial things in a CWnd derived object from a secondary thread.

In your loop, you don't check stopFlag immediately upon the wait being satisfied. When shutting down, this could cause problems if the dialog is destructed earlier than hGlobalWriteEvent is set.

The event is a manual event, but isn't being reset.

Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke

GeneralRe: Events and Shared Memory Pin
Grahamfff12-May-04 9:56
Grahamfff12-May-04 9:56 
GeneralRe: Events and Shared Memory Pin
Joe Woodbury12-May-04 10:23
professionalJoe Woodbury12-May-04 10:23 
QuestionWhere can I find some article about technique of VC++ IDE? Pin
bloggs197412-May-04 4:47
bloggs197412-May-04 4:47 
AnswerRe: Where can I find some article about technique of VC++ IDE? Pin
jmkhael12-May-04 4:54
jmkhael12-May-04 4:54 
GeneralThank you, it is. Do anyone has more? Pin
bloggs197412-May-04 8:42
bloggs197412-May-04 8:42 
GeneralMJPEG question Pin
cristane12-May-04 4:45
cristane12-May-04 4:45 
GeneralRe: MJPEG question Pin
Chris Losinger12-May-04 4:59
professionalChris Losinger12-May-04 4:59 
GeneralHelp for mschart problem! Pin
allen_homer12-May-04 4:35
allen_homer12-May-04 4:35 
GeneralConversion from integer to string Pin
jazzlycool12-May-04 4:08
jazzlycool12-May-04 4:08 
GeneralRe: Conversion from integer to string Pin
jmkhael12-May-04 4:14
jmkhael12-May-04 4:14 
GeneralRe: Conversion from integer to string Pin
bikram singh12-May-04 4:25
bikram singh12-May-04 4:25 
GeneralRe: Conversion from integer to string Pin
jazzlycool12-May-04 4:56
jazzlycool12-May-04 4:56 
GeneralRe: Conversion from integer to string Pin
Rafael Fernández López12-May-04 11:04
Rafael Fernández López12-May-04 11:04 
GeneralisValidDoubleValue(double *) Pin
Tibor Blazko12-May-04 3:58
Tibor Blazko12-May-04 3:58 
GeneralRe: isValidDoubleValue(double *) Pin
jmkhael12-May-04 4:20
jmkhael12-May-04 4:20 
GeneralRe: isValidDoubleValue(double *) Pin
Tibor Blazko12-May-04 4:22
Tibor Blazko12-May-04 4:22 
GeneralRe: isValidDoubleValue(double *) Pin
jmkhael12-May-04 4:28
jmkhael12-May-04 4:28 

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.