i needed to use a managed dynamic linked library(c#) in my native code(c++).i found the solution here it was. (http://support.microsoft.com/kb/828736).

but the thing that is bothering me is..

1) are managed dynamic linked libraries used in native code through com act as in process com servers ? . if yes how can it be?

2)if no, then how can dynamic linked library act as out process com server without being carried by an executable .

有帮助吗?

解决方案

This is an in-proc configuration. It's not much more "impossible" than using P/Invoke mechanism directly. When you run regasm it makes necessary changes to the registry so that when the client calls CoCreateInstance() COM knows that it needs to P/Invoke functions from the corresponding .NET assembly.

其他提示

  1. COM knows how to start the CLR for managed DLLs, so this can work for managed DLLs that can run in the appropriate bitness (i.e., AnyCPU or 32/64 bit as appropriate).
  2. For cross-bitness DLLs, I believe that the CLR knows how to start DllHost.exe and run the managed DLL out-of-process. It will be slower, of course.
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top