multithreading - Visual C++ CreateThread Parameter Problem -


I have a class in which there is a function that calls to make threads, Need to pass in the form:

DWORD Thread ID; Handle H = Create trayf (tap, 0, runthread, this, 0, and thread ID);

My runthread definition is as follows:

  DWORD WINAPI runthread (LPVOID ARG) {Obj * t = (Obj *) args; T & gt; Funct (); Return 0; }  

Unfortunately, the object thread running () is truncated in my obverse class function pointer attribute can this be the problem?

  class oz {zero (* function) ();  

and in the manufacturer:

  Obj (zero (* f) ()) {funct = f; }  

Where is my mistake? Function indicator, createThread itself, or type-casting? I tried whatever I could think of.

Object is created properly, assuming that there is a chance to call the CreateThread Is the builder out of the scope? This will leave your thread with a garbage object. If not, one step through the code containing the debugger, and the object is calling the thread on this 'pointer', with a breakpoint on the thread, to see what is happening in the form of the parameter.


Comments