cannot convert from 'overloaded-function' to 'AFX_THREADPROC'
来源:互联网 发布:python getopt模块 编辑:程序博客网 时间:2024/05/20 01:34
m_hThread = AfxBeginThread( ( AFX_THREADPROC )ThreadEntry, this,
THREAD_PRIORITY_NORMAL, 0, CREATE_SUSPENDED, NULL );
THREAD_PRIORITY_NORMAL, 0, CREATE_SUSPENDED, NULL );
线程入口函数声明和定义:
定义:
UINT CxxxWnd::ThreadEntry(void *arg)
{
CxxxWnd *pDlg = (CxxxWnd*)arg;
int res=pDlg->Cfunc();
return 0;
}
CxxxWnd *pDlg = (CxxxWnd*)arg;
int res=pDlg->Cfunc();
return 0;
}
声明:
UINT ThreadEntry(void *arg);
编译报RT错误。
改正:
声明处:
static UINT ThreadEntry(void *arg);
这里ThreadEntry()要为类的静态成员函数,否则就会报RT的错误。
0 0
- cannot convert from 'overloaded-function' to 'AFX_THREADPROC'
- 'WinMain' : function cannot be overloaded
- Cannot convert from 'const char [..]' to 'LPCTSTR'
- Cannot convert from 'const char [..]' to 'LPCTSTR'
- cannot convert from wchar_t * to LPSTR 解决方法
- cannot convert from Test to Annotation
- ambiguous call to overloaded function
- error C2731: 'WinMain' : function cannot be overloaded
- error C2731: 'WinMain' : function cannot be overloaded
- cannot convert parameter 1 from 'class A' to 'class A'
- cannot convert from 'wchar_t *' to 'ATL::CStringT ‘s solution
- error C2440: '=' : cannot convert from 'void *' to 'float (*)[3]'
- VS2008中报错:cannot convert parameter 2 from 'char *' to 'LPCWSTR'
- cannot convert from 'const char [n]' to 'LPCWSTR'2009
- cannot convert from 'wchar_t *' to 'ATL::CStringT ‘s solution
- cannot convert parameter 1 from 'CString' to 'const char *'
- error C2440: 'initializing' : cannot convert from 'unsigned long' to 'void *
- cannot convert parameter from 'class CStdioFile' to 'class CStdioFile'
- Apache+tomcat 反向代理 解决 域名跟端口号问题
- go 语言type Method Values vs. Method Expressions
- 万能PDF转换迅捷PDF转换成Word转换器评测
- linux2.6 makefile分析
- 加拿大PCI GXL地理成像加速器-地理国情大显身手
- cannot convert from 'overloaded-function' to 'AFX_THREADPROC'
- Java基础笔记 – Java中的Exception异常 自定义异常
- 正值巅峰期却选择暂时隐退
- 职业规划 情商高的12大表现
- IDS inundator 测试过程
- matlab 椭圆方程拟合
- hdoj2013
- 不错啊
- 详解UCOS中的内存管理