VC自定义消息ON_MESSAGE的编译错误error C2440

VC6编写的程序移植到VS2010中编译时error C2440: “static_cast”问题的解决 <br /><br />编写自定义消息映射的时候,VS编译器报错:<br />error C2440: “static_cast”: 无法从“LRESULT (__thiscall CSimpleThreadDlg::* )(void)”转换为“LRESULT (__thiscall CWnd::* )(WPARAM,LPARAM)”<br />原因是VC6项目移植到编译时检查更严格的VS2010上,需要针对源代码做出更改,解决方法很简单:<br />ON_MESSAGE消息在afxmsg_.h中有 阅读详情

在手动添加ON_MESSAGE时,遇到下面的编译错误:

error C2440: 'type cast' : cannot convert from 'void (__thiscall CXXXView::*)(unsigned int,long)' to 'long (__thiscall CWnd::*)(unsigned int,long)' Pointers to members have different representations; cannot cast between them

因为是已有工程,且要添加的视图与已存在的视图有很多相似的地方,因此,我使用了Ctrl+C和Ctrl+V,结果编译出现上面的错误。

双击上面的错误,VC定位到ON_MESSAGE(……)一处,没仔细看错误提示,刚开始以为是.h中声明与.cpp中不一致,感觉手工添加消息处理的三个地方好像也没有什么不对,后来,心血来潮,转到了ON_MESSAGE的定义处,才弄明白,原来是因为消息处理函数的返回值类型为void,而ON_MESSAGE宏中,要求消息处理函数的返回值为long,后来将.h和.cpp中函数的返回类型改为LRESULT后编译就通过了……

之前在将VC6.0的工程转换到VC++2005上时,也遇到类似的问题,在VC6中,定义为void的消息处理函数能编译通过,VC++2005却无法通过,将其返回类型改为LRESULT就可以通过了。以后手工添加消息处理的时候,最好还是将返回类型指定为LRESULT。

《Programming Windows with MFC》一书中,How Message Maps Work(中文版1.3.6)中这样写的:

You can find out how message maps work by examining the DECLARE_MESSAGE_MAP, BEGIN_MESSAGE_MAP, and END_MESSAGE_MAP macros in Afxwin.h and the code forCWnd::WindowProc in Wincore.cpp.

消息映射机制是通过三个宏DECLARE_MESSAGE_MAP, BEGIN_MESSAGE_MAP, and END_MESSAGE_MAP 来实现的。

宏DECLARE_MESSAGE_MAP在类中添加了3个成员:

1) _messageEntries:AFX_MSGMAP_ENTRY数组,包含了消息与消息处理程序之间的关联关系。

2) messageMap:AFX_MSGMAP指针,结构中包括指向类中的_messageEntries指针以及指向父类的messageMap指针。

3) GetMessageMap函数(Virtual):返回messageMap指针。

BEGIN_MESSAGE_MAP宏则包含GetMessageMap函数的实现及messageMap的初始化工作。

BEGIN_MESSAGE_MAP和END_MESSAGE_MAP之间出现的代码将被填入到_messageEntries数组中。

c++中的函数前面加个LRESULT表示函数的返回值是LRESULT类型。
需要注意的是LRESULT是一个数据类型:
MSDN: 32-bit value returned from a window procedure or callback function
指的是从窗口程序或者回调函数返回的32位值
在winnt.h中typedef long LONG;
在windef.h中typedef LONG LRESULT;
所以LRESULT就是longresult,也就是长整型
之所以取名类LRESULT,是因为L即long,result表示结果,说明这个函数的返回值是某个结果。


高版本的VS编译低版本的VS程序时,可能会出现以下问题:

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

其原因是消息映射ON_MESSAGE(WM_message,OnMyMessage)中OnMyMessage返回值必须为LRESULT,其形式为:

afx_msg LRESULT OnMyMessage(WPARAM, LPARAM);

如果不符合,则有错误提示:error C2440: “static_cast”: 无法从“void (__thiscall CPppView::* )(WPARAM,LPARAM)”转换为“LRESULT (__thiscall CWnd::* )(WPARAM,LPARAM)” 表示在匹配目标类型的范围内没有具有该名称的函数
    

解决方法如下:

1,把原来的消息函数返回值类型改为LRESULT,函数内可以随便写个return TRUE; 

2.消息函数的参数必须改写成(WPARAM wParam,LPARAM lParam)而不论这两个参数是否用得到;

3.消息映射如ON_MESSAGE(WM_message,& OnMyMessage)。


【Bug已解决】NCCL timeout for validation 解决方案 训练用多卡 DDP / FSDP 正常,但一到或者进程直接 hang 在 eval 的某个集合通信上。最迷惑的是:训练阶段(有集合通信)完全正常,偏偏 eval 阶段(看起来更轻量)超时。因为 eval 阶段某些 rank 没参与 collective,导致参与的那部分 rank 永远等不到同伴。 阅读详情

相关推荐

【电击防护篇】电击防护技术详解:从人体效应到接地系统全解析

本文系统讲解了电击防护的关键知识,包括电流对人体的影响(如30mA是心室颤动阈值)、人体电阻特性(700Ω-6100Ω)以及电气接触防护措施。重点分析了TT、TN和IT三大接地系统的结构特点与应用场景,强调TN-S系统最安全,IT系统供电连续性最佳。详细介绍了漏电保护器(RCD)的工作原理与选型指南,建议人身防护选用30mA高灵敏度RCD。文章通过对比表总结三大系统的安全性、成本及适用场景,为电气安全设计提供实用参考。

2301_81299416的博客 1743

error C2440: 'type cast' : cannot convert from 'int *' to 'void (__thiscall CCmdTarget::*)(void)'解决...

环境:Microsoft Visual C++ 6.0 问题:自定义消息时,出现如下错误:error C2440: 'type cast' : cannot convert from 'int *' to 'void (__thiscall CCmdTarget::*)(void)' ,There is no context in which this conversion is possibl...

数据库天地 2371

ffmpeg中av_read_frame阻塞的原因与解决方案

最近用到ffmpeg,想要av_read_frame立即返回,但是看网上的博客,都没有详细的解说,那就自己看源码。 两种方法: 设置回调打断函数和设置超时 超时,但是如果只设置该参数,依然会在av_read_frame中阻塞, av_dict_set(&inputDic, "stimeout", "2*1000*1000", 0); // milliseconds //打断回调 m_avformatCtx->interrupt_callback.callback = interru

weixin_43360707的博客 1万+

vc++深入详解中error c2440的解决方案

最近看孙鑫老师的VC视频讲座,发现用VS2005直接打开他的源代码,可以编译成功。但是如果自己新建个win32项目,自己敲源代码的话,反而编译不了,有如下错误:  error C2440: “=”: 无法从“const char [11]”转换为“LPCWSTR”       代码在VC6中没问题. 因为它的代码没有按可编译为UNICODE版本的方式写,

追忆似水年华————RUSH 4316

【ROS2】Arduino系列之机器人底盘实现

介绍ros中提供的一个已经封装了的模块: ros_arduino_bridge,该模块由下位机驱动和上位机控制两部分组成,通过该模块可以更为快捷、方便的实现自己的机器人平台

guilin 1486

薄膜比拟、开口截面扭转承载力以及风电混塔水平缝张开状态下抗扭承载力推导

风电混塔水平缝张开状态下的抗扭承载力推导,从弹性力学说起

George的博客 873

深入浅出MFC之6大技术 消息映射( DECLARE_MESSAGE_MAP) 和命令传递 ON_NOTIFY ON_COMMAND ON_MESSAGE 三大难点解析

ON_COMMAND用来响应相应工具栏和菜单栏的命令WM_COMMAND,不用自己解开WM_COMMAND中wParam和lParam中传送的控件ID。ON_COMMAND对应的消息ID一直都是WM_COMMAND. 操作方法:在类向导中,命令tab页 对象id为选择需要的控件ID,消息为command.然后添加处理程序。相当于在 在头文件添加了 afx_msg void func(); ...

baidu_16370559的博客 2911

simulink中MIL测试简单理解

输入信号设置如下:选中New Test Case1 ---INPUT。5、新建(选择New,Test from Spreadsheet)6、可以新建也可以导入(Use existing test)Source:Output为自己预测结果。3、右键子系统(Create)打开生成表格,可以自己调试。4、创建测试用例表格。保存路径为模型路径。保存路径在模型路径。8、运行测试设h置。

lingdianhuat的博客 1784

error C2440: “static_cast”: 无法从“void (__thiscall Dlg::* )(WPARAM,LPARAM)”转换为“LRESULT (__thiscall CWn...

这种情况是将VC6.0下编译的项目转移到VS2005或2008下产生的,主要是ON_MESSAGE()函数的第二个参数引起的,VS要求第二个参数返回值为LRESULT,而VC下是void,故需要将void转变为LRESULT,为题即可解决。 1.根据出错信息是ON_MESSAGE(WM_NOTIFYICON, OnNotifyIcon)函数,在这个函数中存在OnNotifyIcon...

Joanne0106的博客 538

手把手教你学Simulink——四开关 Buck‑Boost(FSBB)变换器的无缝模式切换仿真

本文详细介绍了四开关Buck-Boost(FSBB)变换器的Simulink仿真方法,重点解决模式切换时的直通风险和输出电压波动问题。通过统一电压PI控制、迟滞比较模式仲裁(Buck/Boost/Pass-Through)和200ns死区设计,实现了Vin从26V到22V变化时Vout稳定在12V±0.15V。关键步骤包括:搭建功率级电路、Stateflow模式判断、PI控制器输出占空比映射(Buck模式D≈Vo/Vin,Boost模式D≈1-Vo/Vin),以及带死区的PWM信号分配。仿真验证了切换过程中

MHD0815的博客 116

使用Simulink设计并实现一个可调谐的二阶IIR陷波滤波器,实时去除音频中的工频噪声

《基于Simulink的音频陷波滤波器设计与实现》摘要:本文详细介绍了使用Simulink设计陷波滤波器去除音频工频噪声(如50Hz)的方法。核心内容包括:1)二阶IIR陷波滤波器的原理与传递函数;2)Simulink实现步骤(音频系统搭建、滤波器设计、频率跟踪);3)性能分析(频谱对比、时域波形、听觉测试)。通过精准消除特定频率干扰,同时保留语音信号(200Hz-4kHz),有效提升信噪比(>20dB)。文章还探讨了多陷波级联、自适应算法等高级技巧,为音频处理、语音通信等应用提供实用解决方案。

amy_mhd的博客 156

error C2440: 'static_cast'

一定要注意,函数一定要带参数。 error C2440: “static_cast”: 无法从“void (__thiscall CChatDlg::* )(WPARAM,LPARAM)”转换为“LRESULT (__thiscall CWnd::* )(WPARAM,LPARAM)” 1>        从基类型到派生类型的强制转换需要 dynamic_cast 或 static_c

eddy_liu的专栏 8498

OpenCv —— 检测车牌号(附完整源码)

OpenCv —— 检测车牌号

5601

error C2440: ’static_cast’

<br />error C2440: “static_cast”: 无法从“void (__thiscall CChatDlg::* )(WPARAM,LPARAM)”转换为“LRESULT (__thiscall CWnd::* )(WPARAM,LPARAM)”<br /> 1>        从基类型到派生类型的强制转换需要 dynamic_cast 或 static_cast<br />搜索发现为开发平台迁移问题。<br /> 由vc6.0升级至vs2005以上平台均会遇到这情况,原因为<br

stilling2006的专栏 5915

老版QQ原生表情gif动态

这是老版的QQ表情,不过全是动态的的,Windows照片查看器是不会动的,可以右击用浏览器打开查看,再说一遍是老版的,只是分享给宁愿用老版也要动态的人。

温度PID控制PLC程序

温度PID稳定控制程序,适用于欧姆龙PLC,对其他PLC也具有很大参考价值

程序由VC6.0升级至VS2010后,ON_MESSAGE 出现错误 error C2440

不能转换void (_thiscall CMainFrame::*)(void)to LRESULT (__thiscall CWnd::* )(WPARAM,LPARAM)开发平台由VC6.0升级至VS2010,需要将原有的项目迁移,可能碰到类似错误: error C2440: 'static_cast' : cannot convert from 'void (__thiscall CMain...

mikasoi的博客 2352

STM32F407中文手册

STM32f407中文手册 本参考手册面向应用开发人员,提供有关使用 STM32F405xx/07xx、STM32F415xx/17xx、 STM32F42xxx 和 STM32F43xxx 微控制器存储器与外设的完整信息。STM32F405xx/07xx、STM32F415xx/17xx、STM32F42xxx 和 STM32F43xxx 构成一个微 控制器系列,各产品具有不同的存储器大小、封装和外设。有关订购信息以及器件的机械与电气特性,请参见数据手册。有关 ARM Cortex™-M4F 内核的信息,请参见《Cortex™-M4F 技术参考手册》。

error C2440 “static_cast” 无法从“void (__thiscall CPppView )(void)”转换为“LRESULT (__thiscall

  error C2440 “static_cast” 无法从“void (__thiscall CPppView )(void)”转换为“LRESULT (__thiscall CWnd )(WPARAM,LPARAM)”        不能转换void (_thiscall CMainFrame::*)(void)to LRESULT (__thiscall CWnd::* )

yanpingsz的专栏 7580

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

编译ERROR C2440

编译ERROR C2440作者:ImMcss 欢迎转载,请以超链接形式保留原文地址。问题:把VC6.0 的工程移植到VC2005上编译出现第一个问题就是: error C2440: static_cast : void (__thiscall CXXXDlg::* )(WPARAM,LPARAM) から LRESULT (__thiscall CWnd::* )(WPARAM,LPA

immcss的专栏 1295

error C2440: 'static_cast' : cannot convert from 'void (__thiscall CMainFrame::* )(void)' to 'LRESUL

不能转换void (_thiscall CMainFrame::*)(void)to LRESULT (__thiscall CWnd::* )(WPARAM,LPARAM) 开发平台由VC6.0升级至VS2005,需要将原有的项目迁移,可能碰到类似错误: error C2440: 'static_cast' : cannot convert from 'void (__thiscall

sunshinewave的专栏 4628

error C2440 “static_cast” 无法从“void (__thiscall C* )(void)...

开发平台由VC6.0升级至VS2005以上的版本,需要将原有的项目迁移,可能碰到类似错误:error C2440:  “static_cast” 无法从“void (__thiscall C* )(void)...VS2005之后的版本对消息的检查更为严格,以前在VC6下完全正常运行的消息映射在VS2005下编译不通过[cpp] view plain copyON_MESSAGE(WM_messa...

Walker_m的博客 2502

VS2010 error C2440: 'static_cast' : cannot convert from 'void (__thiscall CKeyexeDlg::* )(WPARAM,LP

j今天导入一个新项目,使用VC++6.0做的,导入到VS2010就出现差错了,网上查了一些资料,说的就是在VC6.0上每错,在VS2003+版本上就有错误了。 error C2440: 'static_cast' : cannot convert from 'void (__thiscall CKeyexeDlg::* )(WPARAM,LPARAM)'  报错的位置是这一句  ON_ME

缎锦小妹的专栏 1482

error C2440: 'static_cast' LRESULT LRESULT错误

<br />最近开发平台由VC6.0升级至VS2005,需要将原有的项目迁移,特将碰到的问题归纳如下:<br />1消息映射<br />VS2005对消息的检查更为严格,以前在VC6下完全正常运行的消息映射在VS2005下编译不通过<br />a. ON_MESSAGE(message,OnMyMessage);<br />   OnMyMessage返回值必须为LRESULT,其形式为:afx_msg LRESULT OnMyMessage(WPARAM, LPARAM);如果不符合,则有错误提示:<br

书山有路勤为径 6879

error C2440: “static_cast”: 无法从“void (__thiscall CChatDlg::* )(WPARAM,LPARAM)

当用VS2010打开VC6的程序时会出现以下问题:error C2440: “static_cast”: 无法从“void (__thiscall CChatDlg::* )(WPARAM,LPARAM)”转换为“LRESULT (__thiscall CWnd::* )(WPARAM,LPARAM)”从基类型到派生类型的强制转换需要 dynamic_cast 或 static_cast   由V...

Walker_m的博客 2275

错误 C2440 “static_cast”: 无法从“long (__thiscall C*::* )(WPARAM,CView *)”转换为“LRESULT (__thiscall

前言 严重性 代码 说明 项目 文件 行 禁止显示状态 错误 C2440 “static_cast”: 无法从“long (__thiscall CKMainWnd::* )(WPARAM,CView *)”转换为“LRESULT (__thiscall CWnd::* )(WPARAM,LPARAM)” opctestclient e:\centerproject\opc\visual c++ opc client example\mainwn...

aoxuestudy的专栏 3802
上一篇: MFC获取窗口句柄的方法
下一篇: VC++的链接错误LNK2005
heary29
博客等级 码龄12年 37粉丝 85原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值