multi threading
-
ok this is going to be a stupid question to 99.9% of you but i cant figure out what im missing i can not figure out how to add the following Controlling Function Example This example shows how to define a controlling function and use it from another portion of the program. UINT MyThreadProc( LPVOID pParam ) { CMyObject* pObject = (CMyObject*)pParam; if (pObject == NULL || !pObject->IsKindOf(RUNTIME_CLASS(CMyObject))) return 1; // if pObject is not valid // do something with 'pObject' return 0; // thread completed successfully } // inside a different function in the program . . . pNewObject = new CMyObject; AfxBeginThread(MyThreadProc, pNewObject); i always get errors on the UNIT what is the right way to implement the controlling function in vc++ 6? im using mfc
-
ok this is going to be a stupid question to 99.9% of you but i cant figure out what im missing i can not figure out how to add the following Controlling Function Example This example shows how to define a controlling function and use it from another portion of the program. UINT MyThreadProc( LPVOID pParam ) { CMyObject* pObject = (CMyObject*)pParam; if (pObject == NULL || !pObject->IsKindOf(RUNTIME_CLASS(CMyObject))) return 1; // if pObject is not valid // do something with 'pObject' return 0; // thread completed successfully } // inside a different function in the program . . . pNewObject = new CMyObject; AfxBeginThread(MyThreadProc, pNewObject); i always get errors on the UNIT what is the right way to implement the controlling function in vc++ 6? im using mfc
locoone wrote:
i always get errors on the UNIT what is the right way to implement the controlling function in vc++ 6?
What specific errors? The proper prototype for the thread procedure is
UINT __cdecl MyControllingFunction( LPVOID pParam );
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
locoone wrote:
i always get errors on the UNIT what is the right way to implement the controlling function in vc++ 6?
What specific errors? The proper prototype for the thread procedure is
UINT __cdecl MyControllingFunction( LPVOID pParam );
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
thank you very much mark you helped and didnt even know it and you missed where i was messing up UNIT <--- mine UINT <--- yours btw i go it working first try after learning to spell lol
:)
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
thank you very much mark you helped and didnt even know it and you missed where i was messing up UNIT <--- mine UINT <--- yours btw i go it working first try after learning to spell lol
This remind me a maths exam some years ago... 1*1 = 2 :doh:;P;)
Greetings. -------- M.D.V. If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you ;)