将VC ++应用程序移植到VS2008的问题 [英] Issue in porting VC++ application to VS2008

查看:71
本文介绍了将VC ++应用程序移植到VS2008的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个用VC ++开发的应用程序,它使用第三方dll,它也是用VC ++开发的。



应用程序现在移植到VS2008,并且调用dll的代码没有变化。

正常功能在调用DLL函数后工作正常



但是在尝试使用Dialog调用函数时,例如



I had an application developed in VC++ that uses a third party dll which also is developed in VC++
It works fine, and when checked with dependency walker, the application and dll depends on MFC42.dll, MSVCRT.dll, MSVCP60.dll etc.

The application is now ported to VS2008, and there is no change in the code that invoke the dll.
Normal functionalities works fine after invoking the DLL functions

But while trying to invoke function with Dialog, like

MyFunc(void)
{
handle = AfxGetResourceHandle();
AfxSetResourceHandle(::GetModuleHandle(mydll));
if( myCDialog.DoModal() == IDOK )
{
/* My Functionality */
}
AfxSetResourceHandle(handle);
}



尝试执行DoModal时,MFC42.dll(c0000005)中存在访问冲突错误。



exe代码很好,因为它可以与VS2008及更高版本的dll完美配合。



使用vc ++ dll时解决此错误的任何方法在vs2008 exe中?


There is an error Access Violation in MFC42.dll (c0000005) while trying to execute DoModal.

The exe code is fine, as it can perfectly work with dll's made with VS2008 and higher.

Any way to resolve this error when using vc++ dll's in vs2008 exe?

推荐答案

在不同的库中使用不同的MFC版本时,我从未发现基于MFC的项目能够很好地工作。您最好的选择可能是尝试升级DLL。



或者,您可以尝试查看调用堆栈以查看导致错误的原因。如果我不得不猜测,那将是没有意义的事情,纯粹是由于MFC的差异造成的。
I've never found MFC based projects to work very well when using different MFC versions in different libraries. Your best option is likely going to be try to upgrade the DLL.

Alternatively, you can try to look at the call stack to see what's causing the error. If I had to guess though, it's going to be something that doesn't make sense and is purely caused by differences in MFC.


这篇关于将VC ++应用程序移植到VS2008的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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