请看下一段代码
CDllApp theApp;
DWORD dwThreadID = 0;//线程标量
DWORD WINAPI sendmail()//发送邮件
{
::AfxMessageBox("");
return 1;
}
bool thread()
{
dwThreadID=dwThreadID+1;
CreateThread(NULL, 0, sendmail,(void *)0, NULL, &dwThreadID);
return 1;
}BOOL CDllApp::InitInstance()
{
if (!AfxSocketInit())
{
AfxMessageBox(IDP_SOCKETS_INIT_FAILED);
return FALSE;
} return TRUE;
}我创建了一个普通的DLL,只有上面一点代码,可是不能编译,VC6提示:
dll.cpp
D:\d\dll\dll.cpp(73) : error C2664: 'CreateThread' : cannot convert parameter 3 from 'unsigned long (void)' to 'unsigned long (__stdcall *)(void *)'
        None of the functions with this name in scope match the target type
Error executing cl.exe.