I want to create an IDispatch object that returns a value for every property. Ask it for "foo", it returns something. "bar" returns something. "faid1jhgi31jifj" as well.
Any pointers?
I want to create an IDispatch object that returns a value for every property. Ask it for "foo", it returns something. "bar" returns something. "faid1jhgi31jifj" as well.
Any pointers?
You need to override the GetIDsForNames
methods with an appropriate implementation that returns a valid DISPID
for any input parameters. Then override the Invoke
method to ensure to return the correct value based on the dispatch id.
You should also look at IDispatchEx, which is designed to give more flexibility for dynamic interfaces.