Click here to Skip to main content
15,916,423 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: passing class object to thread Pin
Naveen1-Mar-07 20:43
Naveen1-Mar-07 20:43 
GeneralRe: passing class object to thread Pin
neha.agarwal271-Mar-07 20:49
neha.agarwal271-Mar-07 20:49 
GeneralRe: passing class object to thread Pin
Naveen1-Mar-07 20:53
Naveen1-Mar-07 20:53 
GeneralRe: passing class object to thread Pin
neha.agarwal271-Mar-07 21:08
neha.agarwal271-Mar-07 21:08 
GeneralRe: passing class object to thread Pin
Naveen1-Mar-07 21:17
Naveen1-Mar-07 21:17 
GeneralRe: passing class object to thread Pin
neha.agarwal271-Mar-07 21:22
neha.agarwal271-Mar-07 21:22 
GeneralRe: passing class object to thread Pin
Naveen1-Mar-07 22:19
Naveen1-Mar-07 22:19 
AnswerRe: passing class object to thread Pin
BadKarma1-Mar-07 22:43
BadKarma1-Mar-07 22:43 
Hi,

For passing info into a user thread you should make a set function

The you create the thread suspended like in your example.
Next you can initialize the thread giving it all the required info, data & objects.
Then you start the thread

CMyThread* pThread = (CMyThread*) AfxBeginThread( RUNTIME_CLASS(CMyThread),
THREAD_PRIORITY_NORMAL, NULL, CREATE_SUSPENDED, NULL);

Commo* pC = new Commo();
pThread->SetCommo(pC);

pThread->ResumeThread();


This seems to me to be the simplest way to achieve this. (I always use this way Poke tongue | ;-P )

codito ergo sum

QuestionCWebBrowser2 Control Pin
Sonani Prakash1-Mar-07 20:02
Sonani Prakash1-Mar-07 20:02 
AnswerRe: CWebBrowser2 Control Pin
Sameer_Thakur1-Mar-07 21:12
Sameer_Thakur1-Mar-07 21:12 
GeneralRe: CWebBrowser2 Control Pin
Sonani Prakash1-Mar-07 21:59
Sonani Prakash1-Mar-07 21:59 
QuestionProblem while using Windows Registry Pin
harsh_29611-Mar-07 18:53
harsh_29611-Mar-07 18:53 
AnswerRe: Problem while using Windows Registry Pin
Mark Salsbery1-Mar-07 18:58
Mark Salsbery1-Mar-07 18:58 
GeneralRe: Problem while using Windows Registry Pin
harsh_29611-Mar-07 19:43
harsh_29611-Mar-07 19:43 
AnswerRe: Problem while using Windows Registry Pin
prasad_som1-Mar-07 18:58
prasad_som1-Mar-07 18:58 
AnswerRe: Problem while using Windows Registry Pin
ThatsAlok1-Mar-07 20:31
ThatsAlok1-Mar-07 20:31 
GeneralRe: Problem while using Windows Registry Pin
harsh_29611-Mar-07 19:43
harsh_29611-Mar-07 19:43 
GeneralRe: Problem while using Windows Registry Pin
Hamid_RT1-Mar-07 20:36
Hamid_RT1-Mar-07 20:36 
GeneralRe: Problem while using Windows Registry Pin
ThatsAlok1-Mar-07 21:21
ThatsAlok1-Mar-07 21:21 
QuestionHow to get body of new arrived mail? Pin
Shashi Shinde1-Mar-07 18:36
Shashi Shinde1-Mar-07 18:36 
GeneralRe: How to get body of new arrived mail? Pin
Programm3r1-Mar-07 20:25
Programm3r1-Mar-07 20:25 
GeneralPlease fix your reply[OT] Pin
prasad_som1-Mar-07 20:21
prasad_som1-Mar-07 20:21 
QuestionRe: How to get body of new arrived mail? [modified] Pin
Programm3r1-Mar-07 20:27
Programm3r1-Mar-07 20:27 
AnswerRe: How to get body of new arrived mail? Pin
Shashi Shinde1-Mar-07 20:55
Shashi Shinde1-Mar-07 20:55 
GeneralRe: How to get body of new arrived mail? Pin
Programm3r1-Mar-07 21:00
Programm3r1-Mar-07 21:00 

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.