激活上下文问题 [英] Activation Context issues

查看:103
本文介绍了激活上下文问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个激活上下文问题和SxS问题.希望我能很好地解释它.

I have an activation context problem and SxS issue. Hopefully I'll be able to explain it well.

 

我有一个包含许多COM类和接口的COM库-该库在多个应用程序之间共享.

I have COM library containing many COM classes and interfaces - this library is shared between several applications.

我有一个使用此COM库的应用程序.

I have an application using this COM library.

到目前为止,COM库已在计算机上注册,因此我的应用程序可以使用它.

Till now, the COM library was registered on the machine, so my application was able to use it.

从现在开始,我希望不注册即可将我的COM库部署在计算机上.

From now on I want  my COM library to be deployed on the machine with no registration.

为了使其正常工作,我为COM库创建了一个清单文件,我想使用激活上下文API来享受SxS和免注册功能.

In order to make it work, I created a manifest file for my COM library and I wanted to use the activation context API in order to enjoy SxS and registration free capabilities.

 

我认为,如果要在应用程序的开头添加到我的应用程序中,创建/激活激活上下文,并在应用程序终止过程中取消激活/释放激活上下文,就可以了.

I thought that if l'll add to my application creation/activation of Activation Context in the beginning of application and will deactivate/release the activation context during the application termination process  all will be fine.

我错了:-(

我的应用程序打开和关闭各种形式和对话框,但并非所有都是我开发的.这会以某种方式影响激活上下文堆栈,并且无法使用我的CMO库.

My application opens and closes various forms and dialogs, not all of them were developed by me. This somehow affects the activation contexts stack and my CMO library can't be used.

请注意,如果我将激活上下文创建/销毁的范围缩小为包装每个COM库调用,则问题将得到解决.

Note that  if I'll reduce the scope of the activation context creation/destruction to wrap each and every COM library call, the problem will be solved.

该解决方案是不可接受的,因为我的应用程序已经在市场上,并且包装每个COM库调用都是不可接受的.

This solution is not acceptable since my application is already on the market and wrapping each and every COM library call is no acceptable. 

 

这个问题熟悉吗?如果是这样,有办法克服吗?

Is this problem familiar? if so, is there a way to overcome it?

是否有一种方法来定义整个过程而不是每个线程的激活上下文?

Is there a way to define activation context per the entire process and not per thread?

 

 

谢谢

R.

推荐答案

我有一个激活上下文问题和SxS问题.希望我能很好地解释它.

I have an activation context problem and SxS issue. Hopefully I'll be able to explain it well.

 

我有一个包含许多COM类和接口的COM库-该库在多个应用程序之间共享.

I have COM library containing many COM classes and interfaces - this library is shared between several applications.

我有一个使用此COM库的应用程序.

I have an application using this COM library.

到目前为止,COM库已在计算机上注册,因此我的应用程序可以使用它.

Till now, the COM library was registered on the machine, so my application was able to use it.

从现在开始,我希望不注册即可将我的COM库部署在计算机上.

From now on I want  my COM library to be deployed on the machine with no registration.

为了使其正常工作,我为COM库创建了一个清单文件,我想使用激活上下文API来享受SxS和免注册功能.

In order to make it work, I created a manifest file for my COM library and I wanted to use the activation context API in order to enjoy SxS and registration free capabilities.

 

我认为,如果要在应用程序的开头添加到我的应用程序中,创建/激活激活上下文,并在应用程序终止过程中取消激活/释放激活上下文,就可以了.

I thought that if l'll add to my application creation/activation of Activation Context in the beginning of application and will deactivate/release the activation context during the application termination process  all will be fine.

我错了:-(

我的应用程序打开和关闭各种形式和对话框,但并非所有都是我开发的.这会以某种方式影响激活上下文堆栈,并且无法使用我的CMO库.

My application opens and closes various forms and dialogs, not all of them were developed by me. This somehow affects the activation contexts stack and my CMO library can't be used.

请注意,如果我将激活上下文创建/销毁的范围缩小到 包装每个COM库调用,此问题将得到解决.

Note that  if I'll reduce the scope of the activation context creation/destruction to wrap each and every COM library call, the problem will be solved.

该解决方案是不可接受的,因为我的应用程序已经在市场上,并且包装每个COM库调用都是不可接受的.

This solution is not acceptable since my application is already on the market and wrapping each and every COM library call is no acceptable. 

 

这个问题熟悉吗?如果是这样,有办法克服吗?

Is this problem familiar? if so, is there a way to overcome it?

是否有一种方法来定义整个过程而不是每个线程的激活上下文?

Is there a way to define activation context per the entire process and not per thread?

 

 

谢谢

R.


这篇关于激活上下文问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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