本文介绍了错误C2605未声明的标识符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在执行代码时遇到问题
错误是类的构造函数中的L未定义
#define _AFXDLL #include " afxwin.h" class COurApp: public CWinApp { 公共: 虚拟 BOOL InitInstance(); }; 类 COurWnd:公共 CFrameWnd { 公共: // 构造函数 COurWnd() { 创建( 0 ,L " 我们的哑窗口应用程序" ); } }; BOOL COurApp :: InitInstance( void ) { m_pMainWnd = 新 COurWnd; m_pMainWnd-> ShowWindow(m_nCmdShow); // ...并显示 返回 TRUE; } COurApp AnApplication;
[修改:使用前置标记可对您的代码进行格式化.另外,使用Tab键使其更具可读性.]
解决方案
M having problem executing the code
error is that L in constructor of class is undefined
#define _AFXDLL #include "afxwin.h" class COurApp:public CWinApp { public: virtual BOOL InitInstance(); }; class COurWnd:public CFrameWnd { public: // Constructor COurWnd() { Create(0,L "our dumb window application"); } }; BOOL COurApp::InitInstance(void) { m_pMainWnd = new COurWnd; m_pMainWnd->ShowWindow(m_nCmdShow); // ...and display it return TRUE; } COurApp AnApplication;
[Modified: using pre tags gives your code formatting. Also, using the tab key makes it more readable.]
解决方案
这篇关于错误C2605未声明的标识符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!