MConnect为动态库中一导出函数,程序中调用该函数,具体声明如下:
typedef int (__stdcall *FnMConnect)(const char* pszIP, int iPort, const char* pszAccount, const char* pszPwd);
 FnMConnect  fnMConnect;

fnMConnect = (FnMConnect)::GetProcAddress(g_hDll,"MConnect");//g_hDll = ::LoadLibrary(strPath)现在程序中我建了一个线程,如下:
 hSendThread = CreateThread(NULL,0,SendProc,this,0,NULL);  
其中线程函数代码如下:
DWORD WINAPI CVCTestDlg::SendProc(LPVOID lp)
{
return ((C***Dlg*)lp)->SendData();
}DWORD C***Dlg::SendData()
{
........
/*问题是我想在此处调用动态库的那函数,于是如下代码:*/
int hsock = fnMConnect(m_ServerIp, m_port, m_strLoginID,m_strLoginPwd);
/*但是此处错误,调试直接跳出该函数,找了半天也没发现哪儿出问题了,望哪位高手赐教!*/
.........}