如何强制非托管到托管的调用使用默认的应用程序域?
我已经尝试解决这个问题有一段时间了。我有一个 C# 用户控件,包装了一个 activex 控件(通过 RCW 创建的包装器);这个特定的 activex 控件加载 MFC 扩展 dll,该 dll 依赖于 C# WPF 程序集。此 MFC 扩展 dll 通过编译为托管的类(使用 /clr 编译器选项)调用 C# WPF 程序集。
这里的问题是 - 当我的 C# 用户控件在 C# 中加载时;它进入默认应用程序域,一切似乎都工作正常;但是每当从 MFC 扩展 dll 的非托管部分调用它的托管部分时,它就会限制查找 C# WPF 程序集。我用谷歌搜索发现,当从 MFC 扩展 dll 的非托管部分调用托管部分时,似乎会创建另一个应用程序域。现在,我对此一无所知 - 如何强制非托管到托管的调用使用默认的应用程序域?
I have been trying to fix this issue for quite sometime now. I have a C# user control wrapping an activex control (through wrappers created by RCW); This particular activex control loads MFC extension dll which has got C# WPF assembly dependant. This MFC extension dll calls C# WPF assembly through classes compiled as managed (using /clr compiler option).
The problem here is that - when my C# user control gets loaded in C#; It gets into the default app domain and everything seems to be working fine; but whenever a call is made from unmanaged part of MFC extension dll to the managed portion of it, it cramps to find the C# WPF assembly. I googled to find that there seems another appdomain getting created when a call is made from unmanaged portion of MFC extension dll to the managed portion. Right now, I am clueless about this one - How to force the unmanaged to managed calls to use the default appdomain?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论