Windows 7中所需的COM服务器单个实例。 [英] Required single instance of COM servers in windows 7.

查看:72
本文介绍了Windows 7中所需的COM服务器单个实例。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们已经创建了一个COM,它将与一些串口进行通信。为了简化客户端工作,我们创建了一个内部与服务器通信的DLL。客户端将使用dll访问服务器。现在我们遇到了一个问题在Windows 7中。

在Windows 7中,某些应用程序将以管理员模式打开,而某些应用程序将处于正常模式。此时我们的服务器将创建两个实例。

但我们需要任何时候只需要执行一台服务器。同时服务器不需要任何管理员权限。所以有任何扫描仪打开我们的服务器inits默认安全级别,无论安全级别如何。

我已经制作服务器类为单音。我能够看到两个客户端是否以相同模式调用服务器(管理员或正常模式)。但问题是只有两个客户端处于不同的模式。

We have created an COM which will talk to some serial port.in order to simplify the clients work we created an dll which internally talks to the server.Clients will use the dll to access the server.now we are facining one problem in windows 7.
In Windows 7 some applications will open in admin mode and some in normal mode.At that time two instances of our servers are created.
But we require only one server has to be executed at any time.Also server does not require any admin rights.so is there any wat to open our server inits default security leveles irrespective of clents security levels.
I already made the server class as single tone.I am able to see if both the clients invokes the server in same mode(either both in admin or in normal mode).But problem is coming only both clients are in different mode.

推荐答案

你有几个选择。



1.使用COM +。如果我没记错的话,那里有某些实例化选项(我目前没有Windows盒子可用)。

2. http ://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/224fc85f-f9f8-40a5-bd9a-92019d7c50b0/ [ ^ ]或 http://stackoverflow.com/questions/4960085/single-instance-of-atl-com-class [ ^ ],使ATL对象成为单例。



希望这会有所帮助,

Pablo。
You have several options.

1. Use COM+. If I remember right, there are instantiation options somewhere there (I don''t have a Windows box available at the moment).
2. http://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/224fc85f-f9f8-40a5-bd9a-92019d7c50b0/[^], or http://stackoverflow.com/questions/4960085/single-instance-of-atl-com-class[^], to make an ATL object a singleton.

Hope this helps,
Pablo.


这篇关于Windows 7中所需的COM服务器单个实例。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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