views:

29

answers:

0

I am trying to implement registry-free COM explicilty in my code (can't use registry-free COM via an app manifest since that only works on the exe level): I create a static class that loads the COM dll, calls DllGetClassObject, then IClassFactory::CreateInstance().

Works just fine to a point. Implementation details are at http://www.dimastr.com/redemption/security.htm#redemptionloader

But if I instantiate my COM object from multiple threads (e.g. first on the main thread, then from a secondary one), .Net starts asking my objects for IMarshal, which I do not implement.

If the COM library is registered in the registry, everything works fine. If the library is not registered in the registry (which is the whole point of doign all this), .Net asks for IMarshal.

Is there any way i can get the default implementaiton of IMarshal that COM uses internally? Or prevent it from faliling if my object does not implement IMarshal?

Thank you!