视觉工作室在调试模式下附加到进程 [英] visual studio attaching to a process in debug mode

查看:132
本文介绍了视觉工作室在调试模式下附加到进程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个奇怪的问题。

我构建的dll(让我称之为my.dll)在c ++ visual studio 2010使用第三方库.lib)它调用第三方dll(说tp.dll)。

the dll that i built (lets call it my.dll) in c++ visual studio 2010 uses a third party library (say tp.lib) which in turn calls a third party dll (say tp.dll).

用于调试prupose我有在configurationProperties-> debug->命令:Excel.exe
和configurationProperties-> debug-> commandArguments:$(TargetPath)

for debugging prupose i have in configurationProperties->debugging->command: Excel.exe and configurationProperties->debugging->commandArguments: "$(TargetPath)"

在我的电脑中,我也设置PATH变量到tp.dll所在的目录

in my computer i also set PATH variable to the directory where tp.dll resides

现在当我打开F5在visual studio excel打开与my.dll和崩溃给我一个无法打开在DOS模式错误。发生的原因是tp.dll没有部署当调试版本的my.dll部署。

now when i hit the F5 in visual studio excel opens up with my.dll and crashes giving me a "cannot open in dos mode" error. the reason this happens is tp.dll is not deployed when debug version of my.dll is deployed.

当我打开一个excel实例单独和手动删除调试版本的my.dll然后一切正常,我可以看到我在my.dll中写的所有我的功能

when i open an instance of excel seperately and manually drop the debug version of my.dll then everything works fine and i can see all my functions that i wrote in my.dll

唯一的问题是现在我不知道如何调试becuase我不知道如何将视觉工作室附加到单独打开的Excel实例。

the only issue is now i do not know how to debug becuase i do not know how to attach visual studio to the instance of excel i opened up seperately.

我的问题是:

1>如何将Visual Studio连接到已打开的Excel实例

1> how can i attach visual studio to an already opened instance of Excel

2 >我如何打F5,仍然使Excel从PATH变量中指定的目录中选择所需的tp.dll,然后才开始部署my.dll。

2> how can i hit F5 and still make Excel pick up the required tp.dll from the directory specified in the PATH variable before it starts to deploy my.dll.

any 。

提前感谢。

推荐答案

好吧,我想出了一种方法来尝试和错误
1>构建debug dll。
2>打开excel的实例,将my.dll从debug文件夹中删除。
3>在visual studio 2010中:properties-> configurationproperties-> debugging-> command = excel.exe
4> properties-> configurationproperties-> debug-> Attach = yes

okay i figured out a way to do it by trial and error 1>build the debug dll. 2> open instance of excel and drop my.dll from the debug folder to it. 3> in visual studio 2010 : properties->configurationproperties->debugging->command = excel.exe 4>properties->configurationproperties->debugging->Attach = yes

现在你在视觉工作室中打F5了。这将把可视工作室编辑器附加到my.dll的运行副本,这将允许逐步通过代码。

and now you hit F5 in visual studio. this will attach the visual studio editor to the running copy of my.dll which will allow to to step through the code.

这篇关于视觉工作室在调试模式下附加到进程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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