Mark Hammond - 2012-04-28

One issue I see in your c++ code is that you CoCreateInstance with IID_IUnknown, then just cast the result to IDispatch. You should probably either pass IID_IDispatch to CoCreateInstance or explicitly QI for IDispatch after getting the IUnknown. It might be worth experimenting with both of them to see if that changes the behaviour of the object.

Also, another thing you could experiment with is using "makepy" support - ie, use win32com.client.gencache.EnsureDispatch() - this should end up with a makepy generated file where all the interfaces are listed. You should then be able to use win32com.client.CastTo() to get any alternative IDispatch based interfaces from the object.

I doubt the fact the interface is "dual" could be the problem but I can see how the wrong IID to CoCreateInstance could cause that (ie, as an implementation detail, they might always provide an IProviderSession, but when there is a QI for IDispatch they provide the other.