문제

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