Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

worker thread

Status
Not open for further replies.

proguru

Programmer
Mar 31, 2001
19
0
0
PY
How can i send a worker thread a termination message?
For example: I have in my code the following

CWinThread* mythread = AfxBeginThread(MyProcThread, (LPVOID) this);


UINT MyProcThread(LPARAM lparam)
{
.... // some code here
while (TRUE) {
// here i read a pulse from one pin of the parallel port
.....
}
return 0;
}
 
Look below:
mythread->PostThreadMessage(OneMessage,OneWParam,OneLParam);
In this case your thread should listen messages, quite like a WndProc:
UINT MyProcThread(LPARAM lparam)
{
.... // some code here
switch(message)
blablanla and bla again John Fill
1c.bmp


ivfmd@mail.md
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top