dll问题 [英] dll problem

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

问题描述

你好,

我有一个运行良好的应用程序.

我现在制作了我使用的类的DLL.在其中一个类中,它有一个声明,其中调用ParentFrame并设置菜单.
GetParentFrame()-> SetMenu(& FrameMenu);

但是当我在应用程序中使用DLL时,出现未处理的错误,似乎没有找到父框架.

什么是问题所在?

当我调试时具有DLL的应用程序,调试光标未输入DLL的.cpp文件内.我想输入DLL代码.为此应该做些什么?


Pritha

Hello,

I have an application which works fine .

I have now made DLL of the classes which I use.In one of the classes
it has a statement which calls the ParentFrame and sets the menu.
GetParentFrame()->SetMenu(&FrameMenu);

But when I use DLL in my application I get an unhandled error where it seems that the Parent Frame is not found

What must be the problem?

When I debug he application with DLL the debug cursor does not enter inside the DLL''s .cpp file .I want to enter the DLL code .What should be
done for that?


Pritha

推荐答案

MFC的多个线程以及dll都有问题.在这种情况下,GetParentFrame()是罪魁祸首,因为它对CWnd :: FromHandle进行了内部调用,如下所示:

MFC has issues with multiple threads and possibly also with dlls. In this case GetParentFrame() is the culprit as it makes an internal call to CWnd::FromHandle which looks like this:

CWnd* PASCAL CWnd::FromHandle(HWND hWnd)<br />{<br />	CHandleMap* pMap = afxMapHWND(TRUE); //create map if not exist<br />	ASSERT(pMap != NULL);<br />	CWnd* pWnd = (CWnd*)pMap->FromHandle(hWnd);<br /><br />#ifndef _AFX_NO_OCC_SUPPORT<br />	pWnd->AttachControlSite(pMap);<br />#endif<br /><br />	ASSERT(pWnd == NULL || pWnd->m_hWnd == hWnd);<br />	return pWnd;<br />}<br />



afxMapHWND函数可能正在尝试使用全局结构从dll中看不到的.



The afxMapHWND func is probably trying to use global structures that aren''t visible from the dll.


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

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