Click here to Skip to main content
15,886,919 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Multithread Pin
RichardS19-Sep-05 14:53
RichardS19-Sep-05 14:53 
GeneralRe: Multithread Pin
benjnp19-Sep-05 15:33
benjnp19-Sep-05 15:33 
GeneralRe: Multithread Pin
RichardS20-Sep-05 4:21
RichardS20-Sep-05 4:21 
AnswerRe: Multithread Pin
Tim Smith19-Sep-05 18:14
Tim Smith19-Sep-05 18:14 
AnswerRe: Multithread Pin
Jose Lamas Rios19-Sep-05 18:27
Jose Lamas Rios19-Sep-05 18:27 
GeneralRe: Multithread Pin
benjnp20-Sep-05 13:44
benjnp20-Sep-05 13:44 
AnswerRe: Multithread Pin
Roger Stoltz19-Sep-05 21:20
Roger Stoltz19-Sep-05 21:20 
AnswerRe: Multithread Pin
Rainer Schuster19-Sep-05 22:03
Rainer Schuster19-Sep-05 22:03 
You don't have to cast anything!!
<br />
class CMyThread<br />
{<br />
public:<br />
<br />
	CMyThread() {};<br />
	~CMyThread() {};<br />
<br />
	static UINT MyStaticClassBeginThreadProc( LPVOID pParam);<br />
<br />
protected:<br />
	int		m_iSomeMember;<br />
	int		m_iThreadState;<br />
};<br />
<br />
UINT CMyThread::MyStaticClassBeginThreadProc( LPVOID pParam)<br />
{<br />
	//Do something usefull threadstuff!!<br />
	//if you want to use classmembersm<br />
	//pass a this pointer  to the pParam<br />
	//and cast it. i.e. the living object<br />
	//for example:<br />
	CMyThread *pSelf = (CMyThread *)pParam;<br />
<br />
	pSelf->m_iSomeMember	= 1;<br />
	pSelf->m_iThreadState	= 0;<br />
<br />
	return 0;<br />
};<br />
<br />
//.... or<br />
<br />
UINT MyGlobalBeginThreadProc( LPVOID pParam)<br />
{<br />
	//Do something usefull threadstuff!!<br />
	return 0;<br />
};<br />
<br />
typedef struct<br />
{<br />
	int iLen;<br />
	int iState;<br />
	char cType;<br />
} SOMETHREADDATA;<br />
<br />
<br />
//.... later somewhere in your code<br />
<br />
SOMETHREADDATA threadData;<br />
CWinThread *pThread;<br />
CMyThread thread; //initialize the class<br />
pThread = AfxBeginThread( MyGlobalBeginThreadProc, (LPVOID*)&threadData);<br />
pThread = AfxBeginThread( CMyThread::MyStaticClassBeginThreadProc, (LPVOID*)&thread);<br />


:->
GeneralRe: Multithread Pin
benjnp20-Sep-05 17:04
benjnp20-Sep-05 17:04 
AnswerRe: Multithread Pin
Eytukan19-Sep-05 22:45
Eytukan19-Sep-05 22:45 
QuestionCustom WM_NOTIFY NMHDR code Pin
ClickHeRe19-Sep-05 12:37
ClickHeRe19-Sep-05 12:37 
AnswerRe: Custom WM_NOTIFY NMHDR code Pin
nm_11419-Sep-05 20:49
nm_11419-Sep-05 20:49 
GeneralRe: Custom WM_NOTIFY NMHDR code Pin
ClickHeRe20-Sep-05 10:06
ClickHeRe20-Sep-05 10:06 
GeneralRe: Custom WM_NOTIFY NMHDR code Pin
nm_11420-Sep-05 16:39
nm_11420-Sep-05 16:39 
GeneralRe: Custom WM_NOTIFY NMHDR code Pin
ClickHeRe21-Sep-05 9:15
ClickHeRe21-Sep-05 9:15 
GeneralRe: Custom WM_NOTIFY NMHDR code Pin
nm_11421-Sep-05 10:58
nm_11421-Sep-05 10:58 
AnswerRe: Custom WM_NOTIFY NMHDR code Pin
FearTheDoubleShift9-Sep-09 7:13
FearTheDoubleShift9-Sep-09 7:13 
Questionimage ticker Pin
picazo19-Sep-05 11:59
picazo19-Sep-05 11:59 
AnswerRe: image ticker Pin
Mircea Puiu20-Sep-05 1:45
Mircea Puiu20-Sep-05 1:45 
GeneralRe: image ticker Pin
picazo20-Sep-05 5:17
picazo20-Sep-05 5:17 
GeneralRe: image ticker Pin
Mircea Puiu20-Sep-05 6:26
Mircea Puiu20-Sep-05 6:26 
GeneralRe: image ticker Pin
picazo21-Sep-05 5:40
picazo21-Sep-05 5:40 
GeneralRe: image ticker Pin
Mircea Puiu21-Sep-05 6:52
Mircea Puiu21-Sep-05 6:52 
QuestionOdd Pin
benjnp19-Sep-05 10:54
benjnp19-Sep-05 10:54 
AnswerRe: Odd Pin
Christian Graus19-Sep-05 11:32
protectorChristian Graus19-Sep-05 11: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.