Click here to Skip to main content
15,917,575 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: lib/dll file question Pin
goozmo3-Feb-04 22:37
goozmo3-Feb-04 22:37 
GeneralDatabase environment Pin
JensB3-Feb-04 21:38
JensB3-Feb-04 21:38 
GeneralRe: Database environment Pin
Roger Wright4-Feb-04 4:00
professionalRoger Wright4-Feb-04 4:00 
GeneralCan't not read string correctly from resource Pin
Paul.Huang3-Feb-04 20:26
Paul.Huang3-Feb-04 20:26 
GeneralRe: Can't not read string correctly from resource Pin
Diddy4-Feb-04 2:23
Diddy4-Feb-04 2:23 
GeneralRe: Can't not read string correctly from resource Pin
Paul.Huang4-Feb-04 14:52
Paul.Huang4-Feb-04 14:52 
GeneralRe: Can't not read string correctly from resource Pin
Diddy4-Feb-04 23:40
Diddy4-Feb-04 23:40 
Generalcpu info Pin
r i s h a b h s3-Feb-04 20:02
r i s h a b h s3-Feb-04 20:02 
GeneralRe: cpu info Pin
Jijo.Raj3-Feb-04 21:53
Jijo.Raj3-Feb-04 21:53 
GeneralRe: cpu info Pin
Alexander M.,4-Feb-04 3:11
Alexander M.,4-Feb-04 3:11 
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 

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.