I'm trying to do some COM interop and attempting to invoke the INetCfgComponent::RaisePropertyUi
method. I've gotten to the point where I can enumerate devices and get a valid INetCfgComponent
for the adapter that I want to display the UI for.
However, I'm a COM newbie (let alone COM interop) so I have no idea what the third argument in RaisePropertyUi()
is meant to be. I've tried passing in the INetCfgComponent
object that I have, but that just results in a InvalidCastException
.
MSDN has the following to say about the argument:
Pointer to the IUnknown interface. RaisePropertyUi retrieves from IUnknown the interface of the context in which to display a network component's property sheet. RaisePropertyUi uses this interface to restrict the display of the property sheet to the context of a connection.