使用多线程时报错,请教一下是什么问题?
UINT MyThreadProc(LPVOID pParam)
{
CTest3Dlg *me = (CTest3Dlg *)pParam;
((CEdit *)(me->GetDlgItem(IDC_EDIT1)))->SetWindowText("Logoff"); return 0;
}--------------------Configuration: test3 - Win32 Debug--------------------
Linking...
test3Dlg.obj : error LNK2001: unresolved external symbol "public: static unsigned int __cdecl CTest3Dlg::MyThreadProc(void *)" (?MyThreadProc@CTest3Dlg@@SAIPAX@Z)
Debug/test3.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.test3.exe - 2 error(s), 0 warning(s)
UINT MyThreadProc(LPVOID pParam)
{
CTest3Dlg *me = (CTest3Dlg *)pParam;
((CEdit *)(me->GetDlgItem(IDC_EDIT1)))->SetWindowText("Logoff"); return 0;
}--------------------Configuration: test3 - Win32 Debug--------------------
Linking...
test3Dlg.obj : error LNK2001: unresolved external symbol "public: static unsigned int __cdecl CTest3Dlg::MyThreadProc(void *)" (?MyThreadProc@CTest3Dlg@@SAIPAX@Z)
Debug/test3.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.test3.exe - 2 error(s), 0 warning(s)
{
CTest3Dlg *me = (CTest3Dlg *)pParam;
((CEdit *)(me->GetDlgItem(IDC_EDIT1)))->SetWindowText("Logoff"); return 0;
}
这个函数被声明为“全局型”了吗?(当然,至少应是在同一“文件作用域”内)
----------
wohunan()
^_^
----------
wohunan()
----------
woYehunan()检查一下你的函数原形。