Click here to Skip to main content
16,005,162 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
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 
Alexpro wrote:
You should never do that! Never touch the GUI object from a different thread!

I can't agree with you here. There are lots of pitfalls doing GUI stuff from a Worker Thread but it is mostly all doable. The main problem is that MFC's handle map's are maintained on a per thread basis, so your worker thread can't access the CWnd from another thread. It still can use the hWnd to do GUI stuff and also under some circumstances use CWnd's.

I have a simple class I've written which attachs a CWnd* to the current worker threads message map. It is similar to CWnd::Attach() and resolves the MFC problems with ASSERT_VALID( this ). I make use of these techniques in ED for Windows (see sig), which uses threads extensively. If anyone wants a copy let me know.

Neville Franks, Author of ED for Windows. www.getsoft.com
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 
GeneralEMail Pin
10-Jun-02 4:34
suss10-Jun-02 4:34 
GeneralRe: EMail Pin
Mazdak10-Jun-02 4:46
Mazdak10-Jun-02 4:46 

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.