Click here to Skip to main content
15,912,327 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Function Address of CWinthread::Create Pin
ForNow6-Mar-09 6:32
ForNow6-Mar-09 6:32 
AnswerRe: Function Address of CWinthread::Create Pin
Akt_4_U6-Mar-09 2:06
Akt_4_U6-Mar-09 2:06 
GeneralRe: Function Address of CWinthread::Create Pin
ForNow8-Mar-09 15:02
ForNow8-Mar-09 15:02 
GeneralRe: Function Address of CWinthread::Create Pin
ForNow8-Mar-09 22:07
ForNow8-Mar-09 22:07 
AnswerRe: Function Address of CWinthread::Create Pin
Nishad S6-Mar-09 2:08
Nishad S6-Mar-09 2:08 
GeneralRe: Function Address of CWinthread::Create Pin
ForNow6-Mar-09 6:31
ForNow6-Mar-09 6:31 
QuestionRe: Function Address of CWinthread::Create Pin
Eytukan6-Mar-09 2:38
Eytukan6-Mar-09 2:38 
AnswerRe: Function Address of CWinthread::Create Pin
ForNow6-Mar-09 6:31
ForNow6-Mar-09 6:31 
Yes I know but its a plain CwinThread

I would like it to return My own Object Derived from CwinThread e.g.

e.g. as in the MSDN example

so that thread can have acess to my data members function as well as that of CWinThread

// ...
class CSockThread : public CWinThread
{
// ... Other function and member declarations
protected:
CSocket m_sConnected;
};

SOCKET hConnected;

BOOL CSockThread::InitInstance()
{
// Attach the socket object to the socket handle
// in the context of this thread.
m_sConnected.Attach(hConnected);

return TRUE;
}

// This listening socket has been constructed
// in the primary thread.
void CListeningSocket::OnAccept(int nErrorCode)
{
// This CSocket object is used just temporarily
// to accept the incoming connection.
CSocket sConnected;
Accept(sConnected);

// Detach the newly accepted socket and save
// the SOCKET handle.
hConnected = sConnected.Detach();

// After detaching it, it should no longer be
// used in the context of this thread.

// Start the other thread.
AfxBeginThread(RUNTIME_CLASS(CSockThread));
}
Questionabout my career! Pin
Archy_Yu6-Mar-09 1:29
Archy_Yu6-Mar-09 1:29 
AnswerRe: about my career! Pin
TreantBG6-Mar-09 1:43
TreantBG6-Mar-09 1:43 
AnswerRe: about my career! Pin
Hamid_RT6-Mar-09 1:44
Hamid_RT6-Mar-09 1:44 
AnswerRe: about my career! Pin
CPallini6-Mar-09 1:46
mveCPallini6-Mar-09 1:46 
AnswerRe: about my career! Pin
Nishad S6-Mar-09 2:12
Nishad S6-Mar-09 2:12 
AnswerRe: about my career! Pin
Code-o-mat6-Mar-09 2:42
Code-o-mat6-Mar-09 2:42 
AnswerRe: about my career! Pin
Eytukan6-Mar-09 3:02
Eytukan6-Mar-09 3:02 
Questionwebbrowser control - Post Data Pin
TreantBG6-Mar-09 0:33
TreantBG6-Mar-09 0:33 
AnswerRe: webbrowser control - Post Data Pin
_AnsHUMAN_ 6-Mar-09 0:43
_AnsHUMAN_ 6-Mar-09 0:43 
Questionhow to create XML file using MFC Pin
hemlat6-Mar-09 0:20
hemlat6-Mar-09 0:20 
AnswerRe: how to create XML file using MFC Pin
Hamid_RT6-Mar-09 0:24
Hamid_RT6-Mar-09 0:24 
AnswerRe: how to create XML file using MFC Pin
Ash_VCPP6-Mar-09 0:58
Ash_VCPP6-Mar-09 0:58 
GeneralRe: how to create XML file using MFC Pin
hemlat6-Mar-09 1:08
hemlat6-Mar-09 1:08 
GeneralRe: how to create XML file using MFC Pin
Ash_VCPP6-Mar-09 1:12
Ash_VCPP6-Mar-09 1:12 
AnswerRe: how to create XML file using MFC Pin
Eytukan6-Mar-09 3:11
Eytukan6-Mar-09 3:11 
GeneralRe: how to create XML file using MFC Pin
hemlat8-Mar-09 19:37
hemlat8-Mar-09 19:37 
JokeRe: how to create XML file using MFC Pin
Eytukan8-Mar-09 21:00
Eytukan8-Mar-09 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.