您当前的位置: 百科371电脑/网络VC++ → 电脑/网络内容 退出登录 用户管理 用户注册
本类热门文章
相关文章
中原建材网
VC++自定义消息处理

减小字体 增大字体

问题:头文件----------------------#define WM_NUMBERKEY WM_USER+1;#define WM_OPERATIONKEY WM_USER+1;*************************************头文件----------------------// Implementationprotected: HICON m_hIcon; // Generated message map functions //{{AFX_MSG(CCalculatorDlg) virtual BOOL OnInitDialog(); afx_msg void OnSysCommand(UINT nID, LPARAM lParam); afx_msg void OnPaint(); afx_msg HCURSOR OnQueryDragIcon(); //}}AFX_MSG afx_msg void OnNumberKey(UINT nID); afx_msg void OnOperationKey(UINT nID); DECLARE_MESSAGE_MAP()*******************************************.cpp DoDataExchange(CDataExchange* pDX)------------------------------------------------------BEGIN_MESSAGE_MAP(CCalculatorDlg, CDialog) //{{AFX_MSG_MAP(CCalculatorDlg) ON_WM_SYSCOMMAND() ON_WM_PAINT() ON_WM_QUERYDRAGICON() //}}AFX_MSG_MAP ON_COMMAND_RANGE(IDC_NUMBER1,IDC_NUMBER0,OnNumberKey) ON_COMMAND_RANGE(IDC_MINUS,IDC_RESULT,OnOperationKey)END_MESSAGE_MAP()--------------------Configuration: Calculator - Win32 Debug--------------------Compiling...Skipping... (no relevant changes detected)Calculator.cppLinking...CalculatorDlg.obj : error LNK2001: unresolved external symbol protected: void __thiscall CCalculatorDlg::OnOperationKey(unsigned int) (?OnOperationKey@CCalculatorDlg@@IAEXI@Z)CalculatorDlg.obj : error LNK2001: unresolved external symbol protected: void __thiscall CCalculatorDlg::OnNumberKey(unsigned int) (?OnNumberKey@CCalculatorDlg@@IAEXI@Z)Debug/Calculator.exe : fatal error LNK1120: 2 unresolved externals执行 link.exe 时出错.为什么?  

来这里看下,你就知道怎么回事了,呵呵,,,,
祝你成功

VC++中的自定义消息

参考资料:孙鑫 深入详解

如果你对头文件----------------------#define WM_NUMBERKEY WM_USER+1;#define WM_OPERATIONKEY WM_USER+1;*************************************头文件----------------------// Implementationprotected: HICON m_hIcon; // Generated message map functions //{{AFX_MSG(CCalculatorDlg) virtual BOOL OnInitDialog(); afx_msg void OnSysCommand(UINT nID, LPARAM lParam); afx_msg void OnPaint(); afx_msg HCURSOR OnQueryDragIcon(); //}}AFX_MSG afx_msg void OnNumberKey(UINT nID); afx_msg void OnOperationKey(UINT nID); DECLARE_MESSAGE_MAP()*******************************************.cpp DoDataExchange(CDataExchange* pDX)------------------------------------------------------BEGIN_MESSAGE_MAP(CCalculatorDlg, CDialog) //{{AFX_MSG_MAP(CCalculatorDlg) ON_WM_SYSCOMMAND() ON_WM_PAINT() ON_WM_QUERYDRAGICON() //}}AFX_MSG_MAP ON_COMMAND_RANGE(IDC_NUMBER1,IDC_NUMBER0,OnNumberKey) ON_COMMAND_RANGE(IDC_MINUS,IDC_RESULT,OnOperationKey)END_MESSAGE_MAP()--------------------Configuration: Calculator - Win32 Debug--------------------Compiling...Skipping... (no relevant changes detected)Calculator.cppLinking...CalculatorDlg.obj : error LNK2001: unresolved external symbol protected: void __thiscall CCalculatorDlg::OnOperationKey(unsigned int) (?OnOperationKey@CCalculatorDlg@@IAEXI@Z)CalculatorDlg.obj : error LNK2001: unresolved external symbol protected: void __thiscall CCalculatorDlg::OnNumberKey(unsigned int) (?OnNumberKey@CCalculatorDlg@@IAEXI@Z)Debug/Calculator.exe : fatal error LNK1120: 2 unresolved externals执行 link.exe 时出错.为什么?这个问题有好的意见或 建议,请留言
[] [返回上一页] [打 印]
电脑/网络评论 (评论内容只代表网友观点,与本站立场无关!)

用户名: 查看更多评论

分 值:100分 85分 70分 55分 40分 25分 10分 0分

内 容:

         (注“”为必填内容。) 验证码: 验证码,看不清楚?请点击刷新验证码

中原建材网 简单版 站长QQ:382546553