Click here to Skip to main content
15,910,303 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: C++ Multiple inheritance Pin
Cedric Moonen14-May-07 5:04
Cedric Moonen14-May-07 5:04 
GeneralRe: C++ Multiple inheritance Pin
ScotDolan14-May-07 5:14
ScotDolan14-May-07 5:14 
GeneralRe: C++ Multiple inheritance Pin
ScotDolan14-May-07 5:14
ScotDolan14-May-07 5:14 
GeneralRe: C++ Multiple inheritance Pin
ScotDolan14-May-07 7:41
ScotDolan14-May-07 7:41 
GeneralRe: C++ Multiple inheritance Pin
Cedric Moonen14-May-07 7:52
Cedric Moonen14-May-07 7:52 
GeneralRe: C++ Multiple inheritance Pin
ScotDolan14-May-07 8:26
ScotDolan14-May-07 8:26 
GeneralRe: C++ Multiple inheritance Pin
Mark Salsbery14-May-07 8:18
Mark Salsbery14-May-07 8:18 
GeneralRe: Mark Has a, Does a, Where is a, Pin
ScotDolan14-May-07 8:35
ScotDolan14-May-07 8:35 
Mark,
I think you are right, I am thinking I need stop inheriting a ClxThread and declare a clxthread object within the mainloop and poll_lenze class. However, I have been struggling to pass a void ThreadFunc(void) into CreateNewThread(PTHREADFUNC pThreadFunc); which turns the function ThreadFunc into working thread/function. However, if i create a function in mainloop like this static UINT WINAPI MaintainingThreadProc(LPVOID pParam); and pass it into CreateNewThread(PTHREADFUNC pThreadFunc) Than, MaintainingThreadProc() function becomes a worker thread. I really would like to just pass the stardard void ThreadFunc(void) function prototype if possible.

class ClxThread<br />
{<br />
public:<br />
	ClxThread();<br />
	virtual ~ClxThread();<br />
<br />
	typedef unsigned (__stdcall *PTHREADFUNC)(void *);<br />
	//Thread Management<br />
	bool CreateNewThread(void);<br />
	bool CreateNewThread(PTHREADFUNC pThreadFunc);<br />
	bool Wait(); //Wait for thread to end<br />
	bool Suspend(); //Suspend the thread<br />
	bool Resume(); //Resume a suspended thread<br />
	bool Kill(); //Terminate a thread<br />
	bool IsActive(); //Check for activity<br />
<br />
	//override these functions in the derived class<br />
	virtual void ThreadEntry(){ }<br />
	virtual void ThreadExit(){ }<br />
	virtual void ThreadRun(){ }<br />
<br />
	//a friend<br />
	//friend DWORD WINAPI _ThreadFunc(LPVOID  pvThread);<br />
	static UINT  WINAPI _ThreadFunc(LPVOID pParam);<br />
<br />
public:<br />
	HANDLE m_hThread;	// Thread handle<br />
	UINT   uiThreadId;	//<br />
<br />
	bool m_bActive; //activity indicator<br />
	DWORD m_lpId; //Thread ID<br />
};<br />


Scott Dolan
Jernie Corporation
Engineering & Manufacturing
Software, Hardware, & Enclosures

GeneralRe: Mark Has a, Does a, Where is a, Pin
Mark Salsbery14-May-07 9:01
Mark Salsbery14-May-07 9:01 
GeneralRe: Mark Has a, Does a, Where is a, Pin
led mike14-May-07 9:39
led mike14-May-07 9:39 
GeneralThe purpose of the thread class Pin
ScotDolan14-May-07 10:56
ScotDolan14-May-07 10:56 
QuestionRe: The purpose of the thread class Pin
Mark Salsbery14-May-07 11:16
Mark Salsbery14-May-07 11:16 
GeneralRe: The purpose of the thread class Pin
led mike14-May-07 12:33
led mike14-May-07 12:33 
GeneralRe: The purpose of the thread class Pin
ScotDolan15-May-07 3:26
ScotDolan15-May-07 3:26 
GeneralRe: The purpose of the thread class Pin
led mike15-May-07 5:43
led mike15-May-07 5:43 
AnswerRe: The purpose of the thread class Pin
ScotDolan15-May-07 6:14
ScotDolan15-May-07 6:14 
GeneralRe: The purpose of the thread class Pin
led mike15-May-07 7:04
led mike15-May-07 7:04 
AnswerRe: C++ Multiple inheritance Pin
led mike14-May-07 8:01
led mike14-May-07 8:01 
QuestionNetwork Machines Pin
rw10414-May-07 4:33
rw10414-May-07 4:33 
AnswerRe: Network Machines Pin
led mike14-May-07 4:47
led mike14-May-07 4:47 
GeneralRe: Network Machines Pin
rw10414-May-07 5:01
rw10414-May-07 5:01 
QuestionRe: Network Machines Pin
David Crow14-May-07 4:53
David Crow14-May-07 4:53 
AnswerRe: Network Machines Pin
rw10414-May-07 5:00
rw10414-May-07 5:00 
QuestionSimple GDI program Pin
Dustin Henry14-May-07 4:28
Dustin Henry14-May-07 4:28 
AnswerRe: Simple GDI program Pin
Arman S.14-May-07 5:40
Arman S.14-May-07 5:40 

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.