请看下一段代码
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.
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.
解决方案 »
- 如何删除文本文件最后一行或两行的问题
- 请教个vbsctipt使用activex传参数的问题
- 如何实现绘图时浮动的对象?
- 为什么shmget(7879,segsize,IPC_CREAT|0660)后用ipcs看到的key值为0
- 高分求救啊,滚动视图里用MM_ISOTROPIC绘图滚动不了的问题,求解。。。
- windows窗口右上角变成0 2是怎么回事?
- 如何将stl字符串变量转化为MFC的CString变量?
- xxxx.exe中的0x00000000处未处理的异常
- CMsflexgrid1 的乱码问题?
- 谁使用过MatLab?
- 关于Socket的一个非常简单的问题(EventSelect模型的)
- 如何统计程序占用的CPU时间,就像Win2000的性能察看器一样
{
::AfxMessageBox("");
return 1;
}
CreateThread(NULL, 0, &sendmail,NULL, NULL, &dwThreadID);//&sendmail