Click here to Skip to main content
15,894,825 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Getting process ID Pin
«_Superman_»23-Aug-09 19:44
professional«_Superman_»23-Aug-09 19:44 
QuestionTree Control without check box in the root Pin
Ranojay23-Aug-09 19:24
Ranojay23-Aug-09 19:24 
AnswerRe: Tree Control without check box in the root Pin
zhu_lin23-Aug-09 20:49
zhu_lin23-Aug-09 20:49 
GeneralRe: Tree Control without check box in the root Pin
Ranojay23-Aug-09 20:54
Ranojay23-Aug-09 20:54 
GeneralRe: Tree Control without check box in the root Pin
zhu_lin23-Aug-09 21:12
zhu_lin23-Aug-09 21:12 
QuestionRe : Displaying the icons only for subitems in the CListCtrl. Pin
Gokul_md23-Aug-09 19:08
Gokul_md23-Aug-09 19:08 
AnswerRe: Re : Displaying the icons only for subitems in the CListCtrl. Pin
«_Superman_»23-Aug-09 19:50
professional«_Superman_»23-Aug-09 19:50 
QuestionPosting messages while using multiple threads Pin
PaulowniaK23-Aug-09 16:10
PaulowniaK23-Aug-09 16:10 
Hi
I'm new to multi-threading.

I have 2 classes CClass1 and CClass2.

CClass2 creates a new thread. CClass1 needs to trigger a function in this new thread. So I'm thinking of doing

void CClass1::MyCode1()<br />
{<br />
  PostThreadMessage(Class2ThreadID, MY_MESSAGE, wParam, lParam);<br />
}


and catch this in CClass2 using

BEGIN_MSG_MAP(CClass2)<br />
  MESSAGE_HANDLER(MY_MESSAGE, MyCode2)<br />
END_MSG_MAP()


But how do I make sure MyCode2 runs in this thread that I will create in CClass2 as it gets instantiated?

void CClass2::InitThread()<br />
{<br />
  HANDLE myThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) MyCode2, NULL, 0, &Class2ThreadID);<br />
}


Also, I don't want MyCode2 to run until the message is received, but with this, it looks like CreateThread is going to want to run MyCode2 as soon as it creates the thread.

I'm confused.

Please help!
AnswerRe: Posting messages while using multiple threads Pin
«_Superman_»23-Aug-09 18:34
professional«_Superman_»23-Aug-09 18:34 
GeneralRe: Posting messages while using multiple threads Pin
PaulowniaK23-Aug-09 19:38
PaulowniaK23-Aug-09 19:38 
GeneralRe: Posting messages while using multiple threads Pin
«_Superman_»23-Aug-09 19:43
professional«_Superman_»23-Aug-09 19:43 
GeneralRe: Posting messages while using multiple threads Pin
PaulowniaK24-Aug-09 18:54
PaulowniaK24-Aug-09 18:54 
QuestionConnecting (DirectShow) filter pins causes application to quit. Pin
Code-o-mat23-Aug-09 8:03
Code-o-mat23-Aug-09 8:03 
AnswerRe: Connecting (DirectShow) filter pins causes application to quit. Pin
zhu_lin23-Aug-09 20:59
zhu_lin23-Aug-09 20:59 
GeneralRe: Connecting (DirectShow) filter pins causes application to quit. Pin
Code-o-mat24-Aug-09 9:42
Code-o-mat24-Aug-09 9:42 
GeneralRe: Connecting (DirectShow) filter pins causes application to quit. Pin
zhu_lin24-Aug-09 15:14
zhu_lin24-Aug-09 15:14 
QuestionHWND of a control. [modified] Pin
FISH78623-Aug-09 3:30
FISH78623-Aug-09 3:30 
AnswerRe: HWND of a control. Pin
PJ Arends23-Aug-09 6:01
professionalPJ Arends23-Aug-09 6:01 
GeneralRe: HWND of a control. Pin
FISH78623-Aug-09 17:05
FISH78623-Aug-09 17:05 
QuestionHow to detect illegal memory consuming? Pin
Behzad Ebrahimi22-Aug-09 22:19
Behzad Ebrahimi22-Aug-09 22:19 
AnswerRe: How to detect illegal memory consuming? Pin
Chris Losinger23-Aug-09 16:13
professionalChris Losinger23-Aug-09 16:13 
GeneralRe: How to detect illegal memory consuming? Pin
Behzad Ebrahimi23-Aug-09 18:48
Behzad Ebrahimi23-Aug-09 18:48 
AnswerRe: How to detect illegal memory consuming? Pin
zhu_lin23-Aug-09 21:04
zhu_lin23-Aug-09 21:04 
GeneralRe: How to detect illegal memory consuming? Pin
Behzad Ebrahimi23-Aug-09 21:54
Behzad Ebrahimi23-Aug-09 21:54 
AnswerRe: How to detect illegal memory consuming? Pin
Roger Stoltz23-Aug-09 22:10
Roger Stoltz23-Aug-09 22:10 

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.