Click here to Skip to main content
15,910,009 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Help on Multi-Threaded applicaiton Pin
Kiran Satish1-Jul-08 6:04
Kiran Satish1-Jul-08 6:04 
GeneralRe: Help on Multi-Threaded applicaiton Pin
Mark Salsbery1-Jul-08 6:39
Mark Salsbery1-Jul-08 6:39 
GeneralRe: Help on Multi-Threaded applicaiton Pin
Kiran Satish1-Jul-08 6:53
Kiran Satish1-Jul-08 6:53 
GeneralRe: Help on Multi-Threaded applicaiton Pin
Mark Salsbery1-Jul-08 6:57
Mark Salsbery1-Jul-08 6:57 
GeneralRe: Help on Multi-Threaded applicaiton Pin
Kiran Satish1-Jul-08 7:01
Kiran Satish1-Jul-08 7:01 
GeneralRe: Help on Multi-Threaded applicaiton Pin
Mark Salsbery1-Jul-08 7:09
Mark Salsbery1-Jul-08 7:09 
GeneralRe: Help on Multi-Threaded applicaiton Pin
Kiran Satish1-Jul-08 7:05
Kiran Satish1-Jul-08 7:05 
GeneralRe: Help on Multi-Threaded applicaiton Pin
Mark Salsbery1-Jul-08 7:18
Mark Salsbery1-Jul-08 7:18 
How are you creating your threads?

If you're using MFC and using MFC class objects in your threads
you should be using AfxBeginThread(), and the prototype for the
thread proc is

UINT __cdecl ThreadProc(LPVOID pParam);


If you're not using MFC but using CRT functions anywhere in your threads
(including new/delete!) then you should be using _beginthread() or _beginthreadex(),
and the prototype for the thread proc is

unsigned __stdcall ThreadProc(void *lpParameter);


For a pure C/C++ thread on Windows which doesn't use MFC or the CRT, you
can use ::CreateThread(), and the prototype for the thread proc is

DWORD WINAPI ThreadProc(LPVOID lpParameter);


For MFC and/or CRT, make sure you're linking to the multithread version of those libraries.

Mark Salsbery
Microsoft MVP - Visual C++

Java | [Coffee]

GeneralRe: Help on Multi-Threaded applicaiton Pin
Kiran Satish1-Jul-08 12:38
Kiran Satish1-Jul-08 12:38 
GeneralRe: Help on Multi-Threaded applicaiton Pin
Mark Salsbery1-Jul-08 13:34
Mark Salsbery1-Jul-08 13:34 
GeneralRe: Help on Multi-Threaded applicaiton Pin
Kiran Satish1-Jul-08 14:48
Kiran Satish1-Jul-08 14:48 
GeneralRe: Help on Multi-Threaded applicaiton Pin
Mark Salsbery2-Jul-08 5:19
Mark Salsbery2-Jul-08 5:19 
GeneralRe: Help on Multi-Threaded applicaiton Pin
Kiran Satish5-Aug-08 12:22
Kiran Satish5-Aug-08 12:22 
GeneralRe: Help on Multi-Threaded applicaiton Pin
Mark Salsbery6-Aug-08 6:49
Mark Salsbery6-Aug-08 6:49 
GeneralRe: Help on Multi-Threaded applicaiton Pin
Kiran Satish6-Aug-08 10:00
Kiran Satish6-Aug-08 10:00 
GeneralRe: Help on Multi-Threaded applicaiton Pin
Mark Salsbery7-Aug-08 5:41
Mark Salsbery7-Aug-08 5:41 
GeneralRe: Help on Multi-Threaded applicaiton Pin
Kiran Satish7-Aug-08 6:45
Kiran Satish7-Aug-08 6:45 
AnswerRe: Help on Multi-Threaded applicaiton Pin
Simon Cooke15-Oct-08 21:52
Simon Cooke15-Oct-08 21:52 
GeneralRe: Help on Multi-Threaded applicaiton Pin
Kiran Satish6-Aug-08 13:33
Kiran Satish6-Aug-08 13:33 
QuestionGet Running Application's Main Window Pin
vikrant kpr27-Jun-08 12:22
vikrant kpr27-Jun-08 12:22 
Questionwinsock2 recv() returns empty buffer, but correct number of bytes received Pin
Member 427345427-Jun-08 11:14
Member 427345427-Jun-08 11:14 
AnswerRe: winsock2 recv() returns empty buffer, but correct number of bytes received Pin
Mark Salsbery28-Jun-08 11:15
Mark Salsbery28-Jun-08 11:15 
QuestionOLE Automation server's knowledge of client(s) Pin
garyflet27-Jun-08 6:11
garyflet27-Jun-08 6:11 
AnswerRe: OLE Automation server's knowledge of client(s) Pin
Roger Stoltz27-Jun-08 7:42
Roger Stoltz27-Jun-08 7:42 
QuestionRe: OLE Automation server's knowledge of client(s) Pin
garyflet27-Jun-08 8:27
garyflet27-Jun-08 8:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.