我如何调试MFC扩展DLL? [英] How do I debug an MFC extension DLL?

查看:227
本文介绍了我如何调试MFC扩展DLL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我正在使用C ++和MFC创建应用程序。我的应用程序在执行期间从其插件文件夹加载了几个MFC扩展DLL,用户可以选择要在列表中启动哪个。

但是,如果有人想为我的应用程序制作MFC扩展DLL,并且只有可执行文件(不是源代码),那么这个人如何调试其MFC扩展DLL?



我尝试了什么:



我试图按照这个程序:

Hi,

I'm creating an application using C++ and MFC. My app loads several MFC extension DLL from its "Plugins" folder during execution, and the user can choose which one he wants to launch in a list.
However, if someone wants to make a MFC extension DLL for my app, and only have the executable (not the source code), how can this person debug its MFC extension DLL?

What I have tried:

I tried to follow this procedure:

In Solution Explorer, select the DLL project.
From the View menu, choose Property Pages.
In the <Project> Property Pages dialog box, in the Configuration drop-down list box, choose Debug.
Open the Configuration Properties folder and select the Debugging category.
In the Command box, click the drop down arrow and choose Browse from the list to browse for the application.
Enter any necessary program arguments in the Command Arguments box.





来自微软网站。我还在我的应用程序的插件文件夹中添加了我的.dll。

但它没有用,我的应用程序无法从其文件夹中加载任何插件。



from microsoft website. I also added my .dll in the "Plugins" folder of my app.
But it didn't work, and my app couldn't load any plugin from its folder.

推荐答案

您必须为它们提供可执行文件的调试版本,因为MFC无法混合调试和发布模式模块。您不必向他们提供源代码,但我不确定您是否必须为它们提供符号文件.pdb。他们必须在配置属性的调试部分中进行调试构建并指定命令,参数和工作目录,然后他们可以在接口方法中设置断点并调试它们的库。



您可以通过创建一个包含所有必需接口方法的小型骨架库来自行测试,看看它是否有效。它应该相当简单。您将不得不尝试根据.pdb文件等来查看扩展库对您应用的需求。
You have to supply them a debug version of your executable because MFC can't mix debug and release mode modules. You don't have to supply them your source code though and I am not sure whether you have to supply them a symbol file, the .pdb. They have to make a debug build and specify command, arguments, and working directory in the debugging section of the configuration properties then they can set breakpoints in the interface methods and debug their library.

You can test this yourself by making a little skeleton library with all of the required interface methods and see if it works. It should be fairly simple. You will have to experiment to see what the extension library needs from your app in terms of .pdb files and such.


这篇关于我如何调试MFC扩展DLL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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