Windows COM-如何调试COM服务器 [英] Windows COM - how to debug a COM server

查看:52
本文介绍了Windows COM-如何调试COM服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个用完了进程的com服务器(用C ++,ATL编写).在我的一台计算机上,仅通过在调试器下启动COM,设置断点和从客户端进程连接到服务器,就可以轻松调试服务器代码.

I have a com server(written in C++, ATL) that runs out of process. In one of my computers I am able to debug the server code easily just by starting the COM under the debugger, setting breakpoints and connection to the server from a client process.

在我的另一台计算机上不会发生这种情况,如果我从头开始在调试器下启动COM服务器,则客户端将使用同一服务器的另一实例,并且调试服务器的唯一方法是在客户端已经安装后再连接到该服务器.开始了.如何配置?

On my another computer this does not happen, if I start the COM server under the debugger from start, the client uses another instance of the same server and the only way to debug the server is to attch to it after the client already started it. How can this be configured ?

推荐答案

问题在于,在Vista或更高版本下,启动com服务器时,该目录会提升(这样,注册表部分便会在构建结束时进入注册表)),COM客户端将启动另一个COM服务器实例(处于与他相同的完整性级别,例如中等而不是高)

The problem was the fact that under the Vista and up when you start the com server elevated (so that the registry part gets in registry at the end of the build) the COM client will launch another COM server instance (at the same integrity level as he was, e.g. medium and not high)

因此,我必须以普通用户身份(不是以admin身份运行)为服务器运行Visual Studio,并且必须从命令行进行COM注册.

So I had to run Visual Studio for the server as normal user (not run as admin) and had to do the COM registration from command line.

这篇关于Windows COM-如何调试COM服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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