Click here to Skip to main content
15,888,984 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralDoubt ! TAB Messages from child dialog is not going to child dialogs message queue! Pin
Ilamparithi3-Feb-04 19:23
Ilamparithi3-Feb-04 19:23 
GeneralRe: Doubt ! TAB Messages from child dialog is not going to child dialogs message queue! Pin
Diddy4-Feb-04 2:26
Diddy4-Feb-04 2:26 
GeneralMultiple doc/view pairs Pin
flip3-Feb-04 19:23
flip3-Feb-04 19:23 
GeneralRe: Multiple doc/view pairs Pin
Roger Allen4-Feb-04 2:22
Roger Allen4-Feb-04 2:22 
GeneralAccessing the statusbar in a worker thread problem Pin
J.B.3-Feb-04 19:15
J.B.3-Feb-04 19:15 
GeneralRe: Accessing the statusbar in a worker thread problem Pin
Diddy4-Feb-04 2:36
Diddy4-Feb-04 2:36 
GeneralRe: Accessing the statusbar in a worker thread problem Pin
J.B.6-Feb-04 5:05
J.B.6-Feb-04 5:05 
GeneralRe: Accessing the statusbar in a worker thread problem Pin
Diddy8-Feb-04 9:18
Diddy8-Feb-04 9:18 
J.B. wrote:
it works out nicely except a small fix for me to get it compiled -

Arr well, when you write code without a compiler one error isn't bad i suppos Smile | :)

As a general rule of thumb, it's only the classes that interact with Windows etc that will cause you problems (this isn't a golden rule by anymeans) and out of those window classes, it's the ones that are more than just a thin wrapper round the Win32 API that cause problems. For example, CEdit is just a very thin wrapper around a edit control, and works fine, as you found out CStatusBar is more than that - and gives you problems. Its usually the classes that do anything at all with handle maps that don't work - as these are always local to the thread, and since your control is subclassed (by means of a DDX_Control statment) in your main thread,it's handle resides in that threads handle map.

As for the ones that do work - yes, it is safe to use them, but - you have the usual thread issues to think about. MFC classes are thread safe at the class level, but not the object level - IE to different instaces of a the same class provide no problems, but sharing the same instance might. It really depends on your app. You may find you need to use critical sections or other thread sync primatives to protect your control across threads, but you may be able to do without. It's all about thinking about what each thread is doing to the control - usually if one thread is just updating some text in the control, and the other is showing that text, you can get away without them. Where as if both theads are say updating the control's text, you shoud use a critical section to ensure they don't access the control at the same time.

J.B. wrote:
In my case, the changing of statusbar's text is done by its belonging class (my main class) with the original statusbar member. Therefore, no confusing pointer is there. Is it correct?

Sorry, but I really don't unstand what you mean by that?! Is what correct?!
GeneralRe: Accessing the statusbar in a worker thread problem Pin
J.B.8-Feb-04 13:54
J.B.8-Feb-04 13:54 
GeneralWeb View Pin
Prakash Nadar3-Feb-04 18:20
Prakash Nadar3-Feb-04 18:20 
GeneralPLZ help me on web server stuff Pin
laurentz_wei3-Feb-04 15:33
laurentz_wei3-Feb-04 15:33 
GeneralRe: PLZ help me on web server stuff Pin
Christian Graus3-Feb-04 17:51
protectorChristian Graus3-Feb-04 17:51 
GeneralRe: PLZ help me on web server stuff Pin
laurentz_wei3-Feb-04 18:48
laurentz_wei3-Feb-04 18:48 
Questionhow should RegisterHotKey() be used? Pin
Zephyr1233-Feb-04 14:50
sussZephyr1233-Feb-04 14:50 
AnswerRe: how should RegisterHotKey() be used? Pin
Antti Keskinen3-Feb-04 18:23
Antti Keskinen3-Feb-04 18:23 
GeneralRe: how should RegisterHotKey() be used? Pin
zephyr1233-Feb-04 18:43
susszephyr1233-Feb-04 18:43 
GeneralStatus Of Object. Pin
kimsangwoo3-Feb-04 13:19
kimsangwoo3-Feb-04 13:19 
GeneralRe: Status Of Object. Pin
Christian Graus3-Feb-04 17:49
protectorChristian Graus3-Feb-04 17:49 
GeneralRe: Status Of Object. Pin
kimsangwoo3-Feb-04 19:16
kimsangwoo3-Feb-04 19:16 
GeneralRe: Status Of Object. Pin
Steve S3-Feb-04 22:58
Steve S3-Feb-04 22:58 
GeneralSerial project in Visual C++ problem Pin
rmnowick3-Feb-04 12:32
rmnowick3-Feb-04 12:32 
GeneralRe: Serial project in Visual C++ problem Pin
rmnowick4-Feb-04 8:42
rmnowick4-Feb-04 8:42 
Questionhow to print to a specific tray of a printer Pin
asawari3-Feb-04 11:36
asawari3-Feb-04 11:36 
AnswerRe: how to print to a specific tray of a printer Pin
basementman3-Feb-04 16:47
basementman3-Feb-04 16:47 
GeneralCapture windows messages Pin
benny23233-Feb-04 10:22
benny23233-Feb-04 10:22 

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.