投放字幕时出现问题 [英] Problems casting a sub

查看:84
本文介绍了投放字幕时出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HI
当我将VC 6.0迁移到VS 2010时,我得到了

HI
When i migrating VC 6.0 to VS 2010.i got

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



请帮帮我.

谢谢invvance
praveena



PLease help me .

Thanks inadvance
praveena

推荐答案

VS2010和MFC库在执行API的类型匹配方面变得更加严格.大多数MFC API返回LRESULT,并且已将例程定义为返回VOID,因此会出现无法转换"错误.

找到这一行,确定您正在进行的API调用,查找MFC想要的函数的声明,并修复与之匹配的代码.过去,您可以避免不为某些例程返回LRESULT,但是如果API期望返回值,则需要提供一个.

通过实际发布导致错误的相关代码,而不仅仅是发布错误消息,您可以获得更好的答案.
VS2010 and the MFC library have gotten more strict on enforcing type matching of APIs. Most MFC APIs return an LRESULT and you have your routine defined to return VOID so you''re getting the "cannot convert" error.

Find the line, identify the API call you are making, look up the declaration of the function that MFC wants and fix your code to match. In the past, you could get away with not returning an LRESULT for some routines but if the API is expecting a return value, you need to provide one.

You could get a better answer by actually posting the relevant code that got the error, not just posting the error message.


这篇关于投放字幕时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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