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

C / C++ / MFC

 
GeneralRe: thread question? Pin
afender18-Feb-03 19:55
afender18-Feb-03 19:55 
GeneralRe: thread question? Pin
Chintan19-Feb-03 22:00
Chintan19-Feb-03 22:00 
GeneralRe: thread question? Pin
afender18-Feb-03 19:57
afender18-Feb-03 19:57 
GeneralRe: thread question? Pin
HENDRIK R18-Feb-03 22:04
HENDRIK R18-Feb-03 22:04 
GeneralRe: thread question? Pin
afender9919-Feb-03 4:08
afender9919-Feb-03 4:08 
GeneralRe: thread question? Pin
Joe Woodbury19-Feb-03 9:50
professionalJoe Woodbury19-Feb-03 9:50 
GeneralRe: thread question? Pin
afender19-Feb-03 15:41
afender19-Feb-03 15:41 
GeneralRe: thread question? Pin
Joe Woodbury19-Feb-03 19:37
professionalJoe Woodbury19-Feb-03 19:37 
Unfortunately, I mixed two solutions together and blundered. You shouldn't use PostThreadMessage, but rather call the PostMessage of the dialog from the thread. (i.e. mythis->PostMessage(WM_USER + 0x10....)

The value for your user message can be anything, just make sure it's unique (I've made that mistake before.)

You then need to make a custom handler for the Dialog for that specific user message. To make the dialog flexible, in the past I've passed and IDS_ define as the WPARAM (or LPARAM) and then the message handler simply loads that string and updates the edit control. (If you know that only the thread will be setting m_result, then you can get away without a critical section, but that may come back to haunt you someday.)

Here's a link to help explain that.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_MFCNOTES_TN006.asp[^]
GeneralRe: thread question? Pin
afender20-Feb-03 2:41
afender20-Feb-03 2:41 
GeneralModeless Dialog Windows Pin
NickOne18-Feb-03 15:29
NickOne18-Feb-03 15:29 
GeneralRe: Modeless Dialog Windows Pin
Dave Bryant18-Feb-03 16:41
Dave Bryant18-Feb-03 16:41 
Generalextern "C" and static member functions Pin
Jon Hulatt18-Feb-03 11:48
Jon Hulatt18-Feb-03 11:48 
GeneralRe: extern "C" and static member functions Pin
Chris Richardson18-Feb-03 12:03
Chris Richardson18-Feb-03 12:03 
GeneralRe: extern "C" and static member functions Pin
Paul M Watt18-Feb-03 12:12
mentorPaul M Watt18-Feb-03 12:12 
GeneralRe: extern "C" and static member functions Pin
Jon Hulatt18-Feb-03 21:45
Jon Hulatt18-Feb-03 21:45 
GeneralModifying SQL database problem.. Pin
IrishSonic18-Feb-03 11:10
IrishSonic18-Feb-03 11:10 
GeneralRe: Modifying SQL database problem.. Pin
Jon Hulatt18-Feb-03 11:50
Jon Hulatt18-Feb-03 11:50 
QuestionHow to change the background of CDialogBar ? Pin
Yasen Georgiew18-Feb-03 11:05
Yasen Georgiew18-Feb-03 11:05 
AnswerRe: How to change the background of CDialogBar ? Pin
HENDRIK R18-Feb-03 21:20
HENDRIK R18-Feb-03 21:20 
GeneralRe: How to change the background of CDialogBar ? Pin
Yasen Georgiew18-Feb-03 21:48
Yasen Georgiew18-Feb-03 21:48 
GeneralCarchive a CListCtrl (Serialization) Pin
artika18-Feb-03 11:03
artika18-Feb-03 11:03 
GeneralCListCTrl ItemChanged Pin
ns18-Feb-03 8:40
ns18-Feb-03 8:40 
GeneralRe: CListCTrl ItemChanged Pin
Michael Dunn18-Feb-03 9:04
sitebuilderMichael Dunn18-Feb-03 9:04 
GeneralRe: CListCTrl ItemChanged Pin
valikac18-Feb-03 9:10
valikac18-Feb-03 9:10 
GeneralRe: CListCTrl ItemChanged Pin
ns18-Feb-03 9:39
ns18-Feb-03 9:39 

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.