在VS2010中复活MFC/Visual Studio 6.0项目 [英] Resurrecting MFC/Visual Studio 6.0 project in VS2010

查看:191
本文介绍了在VS2010中复活MFC/Visual Studio 6.0项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Visual Studio 2010中构建MFC Visual Studio 6.0项目. 编译器给我一个错误:

I am trying to build a MFC Visual Studio 6.0 project in Visual Studio 2010. The compiler gives me an error:

错误C2440:"static_cast":无法从"void(__thiscall ProgressDialog :: *)(void)'到'LRESULT(__thiscall CWnd :: * )(WPARAM,LPARAM)'

error C2440: 'static_cast' : cannot convert from 'void (__thiscall ProgressDialog::* )(void)' to 'LRESULT (__thiscall CWnd::* )(WPARAM,LPARAM)'

//---------------------------------//消息图

//--------------------------------- // Message map

BEGIN_MESSAGE_MAP(ProgressDialog,CDialog)ON_BN_CLICKED(IDC_CANCEL, OnCancelClicked) ON_MESSAGE (MSG_FINISHED,OnFinished) END_MESSAGE_MAP()

BEGIN_MESSAGE_MAP(ProgressDialog, CDialog) ON_BN_CLICKED(IDC_CANCEL, OnCancelClicked) ON_MESSAGE(MSG_FINISHED, OnFinished) END_MESSAGE_MAP()

任何建议-吗?

佩德罗

推荐答案

将您的ON_MESSAGE宏更改为ON_MESSAGE_VOID. ON_MESSAGE宏从接收WPARAM和LPARAM参数返回LRESULT.您的编译器错误消息指出,您的OnFinished()方法为void参数,返回void.这就是ON_MESSAGE_VOID宏的处理方式.

Change your ON_MESSAGE macro to ON_MESSAGE_VOID. The ON_MESSAGE macro returns a LRESULT from receiving WPARAM and LPARAM arguments. Your compiler error message states that your OnFinished() method is void arguments returning void. That's what the ON_MESSAGE_VOID macro handles.

添加:

请参考 C ++问题与解答的底部A-微软系​​统杂志,1999年7月

这篇关于在VS2010中复活MFC/Visual Studio 6.0项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆