Domanda

I followed the example here to create a C# out-of-process COM server.

My server is used from a third-party application I don't have control over. In order to find out which interfaces they ask for when loading my component, I'd like to log all their calls to the QueryInterface method. However, because I'm using .NET I can't implement IUnknown::QueryInterface on my own - it is instead automatically provided by the CCW (COM callable wrapper).

Is there a way to log all the calls to QueryInterface for my C# COM server?

È stato utile?

Soluzione

I'm sorry for answering my own question, but after some very research intensive days of work, I found that since .NET 4 one can implement ICustomQueryInterface and provide his own managed implementation of QueryInterface. Adding logging to it will be very easy.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top