Click here to Skip to main content
15,896,557 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionStar Shear Pin
AREYASB18-Nov-11 15:58
AREYASB18-Nov-11 15:58 
QuestionRe: Star Shear Pin
David Crow1-Dec-11 7:43
David Crow1-Dec-11 7:43 
QuestionUnderstanding wndproc, callbacks and threads, win32 c++ Pin
jkirkerx18-Nov-11 6:47
professionaljkirkerx18-Nov-11 6:47 
AnswerRe: Understanding wndproc, callbacks and threads, win32 c++ Pin
David Crow18-Nov-11 7:05
David Crow18-Nov-11 7:05 
GeneralRe: Understanding wndproc, callbacks and threads, win32 c++ Pin
jkirkerx18-Nov-11 7:47
professionaljkirkerx18-Nov-11 7:47 
AnswerRe: Understanding wndproc, callbacks and threads, win32 c++ Pin
Chuck O'Toole18-Nov-11 7:46
Chuck O'Toole18-Nov-11 7:46 
GeneralRe: Understanding wndproc, callbacks and threads, win32 c++ Pin
jkirkerx18-Nov-11 8:04
professionaljkirkerx18-Nov-11 8:04 
AnswerRe: Understanding wndproc, callbacks and threads, win32 c++ Pin
Chuck O'Toole18-Nov-11 10:01
Chuck O'Toole18-Nov-11 10:01 
I start the thread in the processing of the button click, in the routine pointed to by ON_BN_CLICKED() entry in the message map.

Where you start yours is up to you but I like to keep the functions of the GUI in the GUI so if you have some "pretty up" work to do, I say do that in the GUI module and then fire up the thread to do the work.

As for the Message Pump, really, I don't think you need to look into that. Basically if the GUI thread is working normally, not freezing while you are doing other processing, etc then it is already using its own message pump and should you should *not* do one yourself. If you move the long running processes into another thread, then the GUI thread should remain responsive.

An alternative message pump is only necessary when you jam all sorts of processing into your message processing routines, like if you tried to do the download inside the routines called when the button was clicked. And, there are folks out there who will say that providing your own message pumps is a hack and should never be done (and you know who you are Smile | :) ) so I'd say hold off discussion on message pumps until you are in the mood to deal with the purists (for the record, I am not one and I do use message pumps when necessary, and no, they are not a hack Smile | :) )
GeneralRe: Understanding wndproc, callbacks and threads, win32 c++ Pin
enhzflep18-Nov-11 15:27
enhzflep18-Nov-11 15:27 
GeneralRe: Understanding wndproc, callbacks and threads, win32 c++ Pin
Richard MacCutchan18-Nov-11 21:57
mveRichard MacCutchan18-Nov-11 21:57 
AnswerRe: Understanding wndproc, callbacks and threads, win32 c++ Pin
Erudite_Eric18-Nov-11 21:55
Erudite_Eric18-Nov-11 21:55 
GeneralRe: Understanding wndproc, callbacks and threads, win32 c++ Pin
jkirkerx19-Nov-11 7:27
professionaljkirkerx19-Nov-11 7:27 
GeneralRe: Understanding wndproc, callbacks and threads, win32 c++ Pin
Erudite_Eric20-Nov-11 2:10
Erudite_Eric20-Nov-11 2:10 
GeneralRe: Understanding wndproc, callbacks and threads, win32 c++ Pin
jkirkerx20-Nov-11 7:27
professionaljkirkerx20-Nov-11 7:27 
GeneralRe: Understanding wndproc, callbacks and threads, win32 c++ Pin
Erudite_Eric20-Nov-11 23:38
Erudite_Eric20-Nov-11 23:38 
GeneralRe: Understanding wndproc, callbacks and threads, win32 c++ Pin
jkirkerx21-Nov-11 7:18
professionaljkirkerx21-Nov-11 7:18 
GeneralRe: Understanding wndproc, callbacks and threads, win32 c++ Pin
Erudite_Eric21-Nov-11 21:01
Erudite_Eric21-Nov-11 21:01 
QuestionHow to disable context-menu web browser control Pin
belfd18-Nov-11 4:28
belfd18-Nov-11 4:28 
QuestionCapturing screen content behind an open window Pin
ryan218917-Nov-11 10:38
ryan218917-Nov-11 10:38 
AnswerRe: Capturing screen content behind an open window Pin
Richard MacCutchan17-Nov-11 11:12
mveRichard MacCutchan17-Nov-11 11:12 
AnswerRe: Capturing screen content behind an open window Pin
Bernhard Hiller18-Nov-11 1:31
Bernhard Hiller18-Nov-11 1:31 
AnswerRe: Capturing screen content behind an open window Pin
Software_Developer18-Nov-11 5:07
Software_Developer18-Nov-11 5:07 
GeneralRe: Capturing screen content behind an open window Pin
ryan218921-Nov-11 5:04
ryan218921-Nov-11 5:04 
QuestionSelLocale in C++ Pin
CliffRat17-Nov-11 7:44
CliffRat17-Nov-11 7:44 
AnswerRe: SelLocale in C++ Pin
Richard MacCutchan17-Nov-11 8:32
mveRichard MacCutchan17-Nov-11 8:32 

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.