ATL problem with CAsyncSocket 
Author Message
 ATL problem with CAsyncSocket

I am using CAsyncSocket in an ATL project and when
CAsyncSocket::AttachHandle gets called it fails because AfxGetModuleState
member variable m_hCurrentInstance is null.  After futher investigation the
member variable m_pCurrentWinApp is also null.  This seems to tell me that
MFC did not get properly initialized inside of the ATL project.  But what
can I do now?  I have tried to initialize the member variables of
AFX_MODULE_STATE but at some point they revert back to NULL.

Thanks

Rob Kreger



Fri, 08 Nov 2002 03:00:00 GMT  
 ATL problem with CAsyncSocket
If CAsyncSocket is all you need from MFC, just go with the raw
WinSock API. This is not a big step...

--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD

MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================


Quote:
> I am using CAsyncSocket in an ATL project and when
> CAsyncSocket::AttachHandle gets called it fails because AfxGetModuleState
> member variable m_hCurrentInstance is null.  After futher investigation
the
> member variable m_pCurrentWinApp is also null.  This seems to tell me that
> MFC did not get properly initialized inside of the ATL project.  But what
> can I do now?  I have tried to initialize the member variables of
> AFX_MODULE_STATE but at some point they revert back to NULL.

> Thanks

> Rob Kreger



Fri, 08 Nov 2002 03:00:00 GMT  
 ATL problem with CAsyncSocket
Also, try avoiding CAsyncSocket isnot exactly async. Check out networking
newsgroups for posts by Felix about the problem regarding this.

--
<mvp val="vc++">
Girish Bharadwaj
</mvp>

Quote:
> If CAsyncSocket is all you need from MFC, just go with the raw
> WinSock API. This is not a big step...

> --
> =====================================
> Alexander Nickolov
> Microsoft MVP [VC], MCSD

> MVP VC FAQ: http://www.mvps.org/vcfaq
> =====================================



> > I am using CAsyncSocket in an ATL project and when
> > CAsyncSocket::AttachHandle gets called it fails because
AfxGetModuleState
> > member variable m_hCurrentInstance is null.  After futher investigation
> the
> > member variable m_pCurrentWinApp is also null.  This seems to tell me
that
> > MFC did not get properly initialized inside of the ATL project.  But
what
> > can I do now?  I have tried to initialize the member variables of
> > AFX_MODULE_STATE but at some point they revert back to NULL.

> > Thanks

> > Rob Kreger



Sat, 09 Nov 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Problem using MFC CAsyncSocket in ATL Service project

2. Problem using MFC CAsyncSocket in ATL Service project

3. Problem with ATL Sink class for catching another ATL's events

4. Problem converting VC6 ATL component to a .NET 2003 VC ATL component

5. Calling ATL server from ATL client problem

6. Problem with ATL Service with ATL 7.0

7. Heap Usage problem with ATL exe - VC 5.0/ATL 2.1

8. Weird problem while debugging a CAsyncSocket object

9. HELP! CAsyncSocket problems

10. Dial-up connection and CAsyncSocket PROBLEMS!

11. Still problems understanding UI-Threads and CAsyncSocket

12. Problem with CAsyncSocket

 

 
Powered by phpBB® Forum Software