Thread
-
Hello how can i create two threads that use the same function using the AfxBeginThread()? (i need them both work simultaneous) can i write something like this: ... AfxBeginThread(Function, ...) AfxBeginThread(Function, ...) ... thanks
Yes. You will get two threads running, each with "Function" as its main.
-
Hello how can i create two threads that use the same function using the AfxBeginThread()? (i need them both work simultaneous) can i write something like this: ... AfxBeginThread(Function, ...) AfxBeginThread(Function, ...) ... thanks
Maybe works, maybe not. I would advise you to move Function() into a class (CWinThread derived) and make instances of the class for every thread. There is a second overload for AfxBeginThread, not taking a function pointer as first param, but a CWinThread-object. Look at http://www.codeproject.com/threads/extended\_thread.asp it demonstrates a similar approch mfg HintiFlo