I am working on a .NET profiler, which I write in C ++ (a DLL using ATL). I want to create a stream that is written to a file every 30 seconds. I want the stream function to be a method of one of my classes
DWORD WINAPI CProfiler::MyThreadFunction( void* pContext )
{
//Instructions that manipulate attributes from my class;
}
when i try to start a thread
HANDLE l_handle = CreateThread( NULL, 0, MyThreadFunction, NULL, 0L, NULL );
I got this error:
argument of type "DWORD (__stdcall CProfiler::*)(void *pContext)"
is incompatible with parameter of type "LPTHREAD_START_ROUTINE"
How to create a thread in a DLL? Any help would be appreciated.
source
share