S
Steven Lien
Does any one know, where i made mistake?
I was thinking to make a virtual thread execution body, so child can simply
extend it
and simply implemented it execution body. But i got a build error message
see below
----------------------------------------------------------------------------
-----------------
//ThreadGroup.cpp
#include <windows.h>
#include <process.h>
#include "threadgroup.h"
/*Start the new thread */
void GameThread::start()
{
thread_handle= _beginthread(run,0,this->thread_data_member); <- caused
error here
}
----------------------------------------------------------------------------
------------------
// threadgroup.h
class GameThread
{
public:
GameThread(PVOID param);
PVOID getThreadDataMemeber();
void start();
virtual VOID run(PVOID test)=0; <- this is function body that i leave as
virtual, look like i have to make it static
to get executed,
any clue for that?
private:
PVOID thread_data_member;
uintptr_t thread_handle;
};
----------------------------------------------------------------------------
-------------------
I used VC++ to compile above code, but it gave me below build error message
beginthread' : cannot convert parameter 1 from 'void (PVOID)' to 'void
(__cdecl *)(void *)'
Any help will be appreciated....
I was thinking to make a virtual thread execution body, so child can simply
extend it
and simply implemented it execution body. But i got a build error message
see below
----------------------------------------------------------------------------
-----------------
//ThreadGroup.cpp
#include <windows.h>
#include <process.h>
#include "threadgroup.h"
/*Start the new thread */
void GameThread::start()
{
thread_handle= _beginthread(run,0,this->thread_data_member); <- caused
error here
}
----------------------------------------------------------------------------
------------------
// threadgroup.h
class GameThread
{
public:
GameThread(PVOID param);
PVOID getThreadDataMemeber();
void start();
virtual VOID run(PVOID test)=0; <- this is function body that i leave as
virtual, look like i have to make it static
to get executed,
any clue for that?
private:
PVOID thread_data_member;
uintptr_t thread_handle;
};
----------------------------------------------------------------------------
-------------------
I used VC++ to compile above code, but it gave me below build error message
beginthread' : cannot convert parameter 1 from 'void (PVOID)' to 'void
(__cdecl *)(void *)'
Any help will be appreciated....