CSocket sockSrvr;
int createSucceed=sockSrvr.Create(pDlg->m_Potr);
就这一句,在使用动态DLL没问题,在使用静态DLL时就出错,
调用堆栈如下:
CMapPtrToPtr::GetValueAt(void * 0x0000097c) line 179 + 3 bytes
CAsyncSocket::LookupHandle(unsigned int 2428, int 0) line 385 + 15 bytes
CAsyncSocket::AttachHandle(unsigned int 2428, CAsyncSocket * 0x0310febc {CSocket}, int 0) line 407 + 13 bytes
CAsyncSocket::Socket(int 1, long 63, int 0, int 2) line 557
CAsyncSocket::Create(unsigned int 34567, int 1, long 63, const char * 0x00000000) line 105 + 20 bytes
CSocket::Create(unsigned int 34567, int 1, const char * 0x00000000) line 45 + 29 bytes问题出在CAsyncSocket类:
AsyncSocket* PASCAL CAsyncSocket::LookupHandle(SOCKET hSocket, BOOL bDead)
{
    CAsyncSocket* pSocket;
    _AFX_SOCK_THREAD_STATE* pState = _afxSockThreadState;
    if (!bDead)
    {
        pSocket = (CAsyncSocket*)
            pState->m_pmapSocketHandle->GetValueAt((void*)hSocket);
        if (pSocket != NULL)
            return pSocket;
    }
    else
    {
        pSocket = (CAsyncSocket*)
            pState->m_pmapDeadSockets->GetValueAt((void*)hSocket);
        if (pSocket != NULL)
            return pSocket;
    }
    return NULL;
}pState->m_pmapSocketHandle为空,出现错误!那位大虾知道是什么原因,请指教。谢谢!