Click here to Skip to main content
15,920,801 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: exception handling Pin
Jason Henderson10-Jun-02 10:31
Jason Henderson10-Jun-02 10:31 
GeneralRe: exception handling Pin
Martin Ziacek10-Jun-02 18:55
Martin Ziacek10-Jun-02 18:55 
GeneralRe: exception handling Pin
John M. Drescher10-Jun-02 20:52
John M. Drescher10-Jun-02 20:52 
GeneralRe: exception handling Pin
Jason Henderson11-Jun-02 2:56
Jason Henderson11-Jun-02 2:56 
GeneralWorker Thread and Main Window Pin
arthivjii10-Jun-02 6:47
arthivjii10-Jun-02 6:47 
GeneralRe: Worker Thread and Main Window Pin
Joaquín M López Muñoz10-Jun-02 7:02
Joaquín M López Muñoz10-Jun-02 7:02 
GeneralRe: Worker Thread and Main Window Pin
John M. Drescher10-Jun-02 20:59
John M. Drescher10-Jun-02 20:59 
GeneralRe: Worker Thread and Main Window Pin
Alexandru Savescu10-Jun-02 7:15
Alexandru Savescu10-Jun-02 7:15 
arthivjii wrote:
From the worked thread I want to access the "Document" class of the MDI Application.

You should never do that! Never touch the GUI object from a different thread! If you step into the code you will see it crashes in the AssertValid function. Here are the comments from the MFC sources:
// Note: if either of the above asserts fire and you are
// writing a multithreaded application, it is likely that
// you have passed a C++ object from one thread to another
// and have used that object in a way that was not intended.
// (only simple inline wrapper functions should be used)
//
// In general, CWnd objects should be passed by HWND from
// one thread to another.  The receiving thread can wrap
// the HWND with a CWnd object by using CWnd::FromHandle.
//
// It is dangerous to pass C++ objects from one thread to
// another, unless the objects are designed to be used in
// such a manner.


You should post a message to the main window instead. For better understanding of the worker threads read Using worker threads

Best regards,
Alexandru Savescu
GeneralRe: Worker Thread and Main Window Pin
arthivjii10-Jun-02 7:30
arthivjii10-Jun-02 7:30 
GeneralRe: Worker Thread and Main Window Pin
Neville Franks10-Jun-02 10:04
Neville Franks10-Jun-02 10:04 
Generalarguments Pin
Nnamdi Onyeyiri10-Jun-02 6:36
Nnamdi Onyeyiri10-Jun-02 6:36 
GeneralRe: arguments Pin
Chris Losinger10-Jun-02 6:53
professionalChris Losinger10-Jun-02 6:53 
GeneralReading Certificates from IE store Pin
User 988510-Jun-02 6:41
User 988510-Jun-02 6:41 
GeneralUpdateData confusion Pin
dazinith10-Jun-02 5:23
dazinith10-Jun-02 5:23 
GeneralRe: UpdateData confusion Pin
Joaquín M López Muñoz10-Jun-02 5:36
Joaquín M López Muñoz10-Jun-02 5:36 
GeneralRe: UpdateData confusion Pin
Ed Gadziemski10-Jun-02 11:32
professionalEd Gadziemski10-Jun-02 11:32 
GeneralRe: UpdateData confusion Pin
dazinith11-Jun-02 3:16
dazinith11-Jun-02 3:16 
GeneralRe: UpdateData confusion Pin
dazinith11-Jun-02 3:17
dazinith11-Jun-02 3:17 
GeneralRe: UpdateData confusion Pin
John M. Drescher10-Jun-02 21:13
John M. Drescher10-Jun-02 21:13 
Generalwatch window in debug doesn't work Pin
John Oliver10-Jun-02 5:12
John Oliver10-Jun-02 5:12 
GeneralRe: watch window in debug doesn't work Pin
Joaquín M López Muñoz10-Jun-02 5:32
Joaquín M López Muñoz10-Jun-02 5:32 
QuestionHow to Dynamically add an Item to Menu? Pin
10-Jun-02 4:44
suss10-Jun-02 4:44 
AnswerRe: How to Dynamically add an Item to Menu? Pin
Lanny Thompson10-Jun-02 4:59
Lanny Thompson10-Jun-02 4:59 
AnswerRe: How to Dynamically add an Item to Menu? Pin
Alexandru Savescu10-Jun-02 5:04
Alexandru Savescu10-Jun-02 5:04 
AnswerRe: How to Dynamically add an Item to Menu? Pin
redeemer10-Jun-02 5:31
redeemer10-Jun-02 5:31 

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.