Click here to Skip to main content
15,907,497 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Createprocess() Pin
punav4-Mar-09 19:30
punav4-Mar-09 19:30 
GeneralRe: Createprocess() Pin
Eytukan4-Mar-09 19:38
Eytukan4-Mar-09 19:38 
Questioncontext menu problem in outlook Pin
nikhil314-Mar-09 17:17
nikhil314-Mar-09 17:17 
AnswerRe: context menu problem in outlook Pin
nikhil315-Mar-09 17:11
nikhil315-Mar-09 17:11 
QuestionWhere is start thread proc in CWinThread Object Pin
ForNow4-Mar-09 16:29
ForNow4-Mar-09 16:29 
AnswerRe: Where is start thread proc in CWinThread Object Pin
Sarath C4-Mar-09 16:57
Sarath C4-Mar-09 16:57 
GeneralRe: Where is start thread proc in CWinThread Object Pin
ForNow4-Mar-09 18:26
ForNow4-Mar-09 18:26 
GeneralRe: Where is start thread proc in CWinThread Object Pin
Stephen Hewitt4-Mar-09 18:45
Stephen Hewitt4-Mar-09 18:45 
You do not start a CWinThread derived thread using Win32's CreateThread[^] function. CWinThread's purpose is to wrap the low level details behind the raw Win32 methods in a nice little object oriented package. The documentation[^] on CWinThread contains the following:
 
To create a thread, call AfxBeginThread. There are two forms, depending on whether you want a worker or user-interface thread. If you want a user-interface thread, pass to AfxBeginThread a pointer to the CRuntimeClass of your CWinThread-derived class. If you want to create a worker thread, pass to AfxBeginThread a pointer to the controlling function and the parameter to the controlling function. For both worker threads and user-interface threads, you can specify optional parameters that modify priority, stack size, creation flags, and security attributes. AfxBeginThread will return a pointer to your new CWinThread object.

Instead of calling AfxBeginThread, you can construct a CWinThread-derived object and then call CreateThread. This two-stage construction method is useful if you want to reuse the CWinThread object between successive creation and terminations of thread executions.


Note: The CreateThread mentioned in the above quote is CWinThread::CreateThread, not Win32's.

Always be wary when mixing the low-level (::CreateThread) with the high level (CWinThread). If you don’t know how the two relate and the manner in which the high level is implemented in terms of the low level you can easily get into trouble.

Steve

GeneralRe: Where is start thread proc in CWinThread Object Pin
ForNow4-Mar-09 21:55
ForNow4-Mar-09 21:55 
QuestionVisual Studio debugging windows Pin
swjam4-Mar-09 16:23
swjam4-Mar-09 16:23 
QuestionAnyone I need some advice and would like to be directed in the right direction if possible. Pin
FISH7864-Mar-09 16:08
FISH7864-Mar-09 16:08 
AnswerRe: Anyone I need some advice and would like to be directed in the right direction if possible. Pin
Stephen Hewitt4-Mar-09 16:26
Stephen Hewitt4-Mar-09 16:26 
GeneralRe: Anyone I need some advice and would like to be directed in the right direction if possible. Pin
FISH7864-Mar-09 16:45
FISH7864-Mar-09 16:45 
GeneralRe: Anyone I need some advice and would like to be directed in the right direction if possible. Pin
Stephen Hewitt4-Mar-09 16:49
Stephen Hewitt4-Mar-09 16:49 
GeneralRe: Anyone I need some advice and would like to be directed in the right direction if possible. Pin
FISH7864-Mar-09 17:07
FISH7864-Mar-09 17:07 
GeneralRe: Anyone I need some advice and would like to be directed in the right direction if possible. Pin
Stephen Hewitt4-Mar-09 17:19
Stephen Hewitt4-Mar-09 17:19 
GeneralRe: Anyone I need some advice and would like to be directed in the right direction if possible. Pin
FISH7864-Mar-09 17:22
FISH7864-Mar-09 17:22 
QuestionProblem reading xml string into data table Pin
Renukapadhamanaban4-Mar-09 12:36
Renukapadhamanaban4-Mar-09 12:36 
QuestionHttpSendRequest Pin
Steve Thresher4-Mar-09 12:26
Steve Thresher4-Mar-09 12:26 
QuestionHelp Accessing Functions in a Dll Pin
Naturality4-Mar-09 10:17
Naturality4-Mar-09 10:17 
AnswerRe: Help Accessing Functions in a Dll Pin
Stuart Dootson4-Mar-09 10:28
professionalStuart Dootson4-Mar-09 10:28 
GeneralRe: Help Accessing Functions in a Dll Pin
Naturality5-Mar-09 5:17
Naturality5-Mar-09 5:17 
GeneralRe: Help Accessing Functions in a Dll Pin
Stuart Dootson5-Mar-09 15:56
professionalStuart Dootson5-Mar-09 15:56 
QuestionHow can I have tow different view type of the same document in a SDI Doc-View based app? Pin
Joseph Marzbani4-Mar-09 9:41
Joseph Marzbani4-Mar-09 9:41 
AnswerRe: How can I have tow different view type of the same document in a SDI Doc-View based app? Pin
Stuart Dootson4-Mar-09 10:22
professionalStuart Dootson4-Mar-09 10:22 

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.