I've got a problem with trying to use a CAsyncSocket in an MFC system service. The service is coded as an EXE and currently being run in console mode (for debugging).
The problem I am having is that after I do my AfxSocketInit() I instantiate the socket as follows
m_pUDPSocket = new CUDPSocket; //( this );
m_pUDPSocket->Create( 2230, SOCK_DGRAM, FD_READ );
when I do the create I get the following assert/message Dialog
Microsoft Visual C++ Debug Libary
Debug Assertion Failed
press retry etc....
now, line 19 is the middle line of the following code
_AFXWIN_INLINE HINSTANCE AFXAPI AfxGetInstanceHandle()
LINE 19-> ASSERT(afxCurrentInstanceHandle != NULL);
SO. my question is obvious. Whats going wrong here, why can't I create my socket?
any help would be appreciated.