<legend id='EpQO0'><style id='EpQO0'><dir id='EpQO0'><q id='EpQO0'></q></dir></style></legend>
  • <i id='EpQO0'><tr id='EpQO0'><dt id='EpQO0'><q id='EpQO0'><span id='EpQO0'><b id='EpQO0'><form id='EpQO0'><ins id='EpQO0'></ins><ul id='EpQO0'></ul><sub id='EpQO0'></sub></form><legend id='EpQO0'></legend><bdo id='EpQO0'><pre id='EpQO0'><center id='EpQO0'></center></pre></bdo></b><th id='EpQO0'></th></span></q></dt></tr></i><div id='EpQO0'><tfoot id='EpQO0'></tfoot><dl id='EpQO0'><fieldset id='EpQO0'></fieldset></dl></div>

      • <bdo id='EpQO0'></bdo><ul id='EpQO0'></ul>

      <small id='EpQO0'></small><noframes id='EpQO0'>

      1. <tfoot id='EpQO0'></tfoot>
      2. 从 .NET Windows 服务调用 COM 组件

        Calling A COM Component From .NET Windows Service(从 .NET Windows 服务调用 COM 组件)

              <bdo id='0Txpz'></bdo><ul id='0Txpz'></ul>
            • <i id='0Txpz'><tr id='0Txpz'><dt id='0Txpz'><q id='0Txpz'><span id='0Txpz'><b id='0Txpz'><form id='0Txpz'><ins id='0Txpz'></ins><ul id='0Txpz'></ul><sub id='0Txpz'></sub></form><legend id='0Txpz'></legend><bdo id='0Txpz'><pre id='0Txpz'><center id='0Txpz'></center></pre></bdo></b><th id='0Txpz'></th></span></q></dt></tr></i><div id='0Txpz'><tfoot id='0Txpz'></tfoot><dl id='0Txpz'><fieldset id='0Txpz'></fieldset></dl></div>
            • <legend id='0Txpz'><style id='0Txpz'><dir id='0Txpz'><q id='0Txpz'></q></dir></style></legend>

              <small id='0Txpz'></small><noframes id='0Txpz'>

                  <tbody id='0Txpz'></tbody>

                1. <tfoot id='0Txpz'></tfoot>
                  本文介绍了从 .NET Windows 服务调用 COM 组件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有一个用 .NET C# 编写的 Windows 服务,它调用一个 COM 组件.我还有一个用于测试 COM 组件的 .NET Windows Forms 测试应用程序.它在测试应用程序中运行良好.但是,当我在 Windows 服务中使用相同的代码时,什么也没有发生.COM 组件将所有内容记录到文件中,并且没有生成日志文件这一事实暗示 COM 组件甚至没有被调用.

                  I have a Windows Service written in .NET C# which calls a COM component. I also have a .NET Windows Forms test app which I was using to test the COM component. It works fine from the test app. However, when I use the same code in the Windows Service nothing happens. The COM components logs everything to file and the fact the log file doesn't get produced hints that the COM component isn't even being called.

                  为什么这在我的测试应用程序中有效,但在 Windows 服务中无效?

                  Why does this work from my test app but not within the windows service?

                  推荐答案

                  服务通常与桌面隔离运行,因此当从服务调用时,您对 COM 组件的调用与 UI 是隔离的.您可以允许服务与桌面交互"参见使用互动服务.

                  Service typically run isolated from the desktop, and therefore your call to the COM component is insulated from the UI when called from the service. You may allow a service to "interactWithDesktop" see the section on Using an Interactive Service.

                  Microsoft(<sarcasm>in their无穷的智慧</sarcasm>)决定从Window vista中删除此功能并推荐将您的应用程序分成多个部分并使用其他机制来完成您之间的通信用户界面和您的服务.显然,有些人(包括我自己)不同意,但是,事实就是这样......

                  Microsoft (<sarcasm>in their infinite wisdom</sarcasm>) Decided that this capability would be removed from Window vista and recommend separating your application into multiple parts and using other mechanisms to accomplish communication between your UI and your service. Obviously, some (including myself) don't agree, but, it is what it is...

                  http://msdn.microsoft.com/en-us/library/ms683502.aspx

                  http:///social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/e50d8819-d628-48e2-aa2c-6ac6de8380d9/

                  这篇关于从 .NET Windows 服务调用 COM 组件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Performance overhead of using attributes in .NET(在 .NET 中使用属性的性能开销)
                  Extract Display name and description Attribute from within a HTML helper(从 HTML 帮助器中提取显示名称和描述属性)
                  How can I force the PropertyGrid to show a custom dialog for a specific property?(如何强制 PropertyGrid 显示特定属性的自定义对话框?)
                  Associate attribute with code generated property in .net(将属性与 .net 中的代码生成属性相关联)
                  Attribute to generate compilation error on method call?(在方法调用上生成编译错误的属性?)
                  Can you omit the parenthesis from attributes with no params?(您可以省略没有参数的属性中的括号吗?)
                      <tbody id='ZzgVX'></tbody>

                    • <bdo id='ZzgVX'></bdo><ul id='ZzgVX'></ul>

                      1. <legend id='ZzgVX'><style id='ZzgVX'><dir id='ZzgVX'><q id='ZzgVX'></q></dir></style></legend>
                        <tfoot id='ZzgVX'></tfoot>

                          <i id='ZzgVX'><tr id='ZzgVX'><dt id='ZzgVX'><q id='ZzgVX'><span id='ZzgVX'><b id='ZzgVX'><form id='ZzgVX'><ins id='ZzgVX'></ins><ul id='ZzgVX'></ul><sub id='ZzgVX'></sub></form><legend id='ZzgVX'></legend><bdo id='ZzgVX'><pre id='ZzgVX'><center id='ZzgVX'></center></pre></bdo></b><th id='ZzgVX'></th></span></q></dt></tr></i><div id='ZzgVX'><tfoot id='ZzgVX'></tfoot><dl id='ZzgVX'><fieldset id='ZzgVX'></fieldset></dl></div>
                        1. <small id='ZzgVX'></small><noframes id='ZzgVX'>