调试Visual Studio 2010 DLL项目 [英] Debugging Visual Studio 2010 DLL Project

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

问题描述

我试图从Visual Studio 2010调试C / C ++本机DLL项目。我试图按照以下说明操作:
http://msdn.microsoft.com/en-us/library/c91k1xcf(v = VS.100).aspx

I'm trying to debug a C/C++ native DLL project from Visual Studio 2010. I'm attempting to follow these instructions: http://msdn.microsoft.com/en-us/library/c91k1xcf(v=VS.100).aspx

我想使用内置的调试器,并能够像常规.exe项目一样执行代码,检查结构等。上面的说明介绍了配置属性中的调试类别,我看不到。

I want to use the built-in debugger and be able to step code, examine structures, etc. as I would do with a regular .exe project. The instructions on the page above describe a Debugging category under Configuration Properties which I do not see.

htt p ://img707.imageshack.us/img707/4402/lalasz.png(删除空格)

htt p://img707.imageshack.us/img707/4402/lalasz.png (remove space)

只需按F5调试结果,出现以下错误:

Just pressing F5 to debug results in the following error:

Unable to start program 'C:\Users\.......Test.dll'

我使用了常规.exe项目的调试器多次,在这台电脑上工作正常。我不知道我现在是否只是丢了一些非常明显的东西。

I've used the debugger for regular .exe projects many times and it works fine on this computer. I'm not sure if I'm just missing something very obvious right now though.

编辑:由于从一开始我没有清楚,我想要Visual Studio到LoadLibrary我的DLL到一个存根进程,让我从源代码级别进行调试,很像OllyDbg这样做。

Since I didn't make it clear from the start, I want Visual Studio to LoadLibrary my DLL into a stub process and let me debug at a source level from there, much like how OllyDbg does it.

我的DLL不是持有的类型一堆要导出和调用的函数。相反,它在DllMain中执行一个开关/例程,而在DLL_PROCESS_ATTACH中将产生一个新的线程。因此,我需要Visual Studio要做的是将我的DLL加载到存根可执行文件中,并允许我设置断点等。

My DLL is not the type that holds a bunch of functions to be exported and called. Instead it does a switch/case in the DllMain and on DLL_PROCESS_ATTACH will spawn a new thread. Therefore all I need Visual Studio to do is to load my DLL into a stub executable and allow me to set breakpoints, etc.

推荐答案

您在解决方案资源管理器窗口中右键单击解决方案名称,并获取解决方案属性。请注意,该窗口显示解决方案测试属性页。

You right-clicked the solution name in the Solution Explorer window and got the solution properties. Note that the window says "Solution Test Property Pages".

右键单击项目名称(以粗体测试),以设置项目选项。

Right-click the project name (Test in bold) instead to set the project options.

这篇关于调试Visual Studio 2010 DLL项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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