Function Address of CWinthread::Create
-
would anyone know what code starts excuting when the Cwinthread::Create creates a thread ???
There isn't a
CWinThread::Create
method. As aboutCWinThread::CreateThread
method, it is defined inthrdcore.cpp
(MFC
sources) you may have a look at it. :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
would anyone know what code starts excuting when the Cwinthread::Create creates a thread ???
The below link will help you. http://www.codeproject.com/KB/threads/extended\_thread.aspx
akt
-
would anyone know what code starts excuting when the Cwinthread::Create creates a thread ???
-
would anyone know what code starts excuting when the Cwinthread::Create creates a thread ???
I think you've been searching to pass a thread function to
CWinThread
? By any chance you aren't aware anAfxBeginThread(YourThreadFunc)
call returns you aCWinThread
?He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus
-
I would like to suggest that you should do a sample application and start debug. Then you can "step into" the code and see yourself what code is being executed.
- ns ami -
-
I think you've been searching to pass a thread function to
CWinThread
? By any chance you aren't aware anAfxBeginThread(YourThreadFunc)
call returns you aCWinThread
?He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus
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)); }
-
There isn't a
CWinThread::Create
method. As aboutCWinThread::CreateThread
method, it is defined inthrdcore.cpp
(MFC
sources) you may have a look at it. :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
The below link will help you. http://www.codeproject.com/KB/threads/extended\_thread.aspx
akt
-
The below link will help you. http://www.codeproject.com/KB/threads/extended\_thread.aspx
akt