Private withevents ClientCallback As COMServerApp.Watch
... Public Sub New()
ClientCallback = ... gets com server object and registers callbakc...
Private Sub ClientCallback _ValueChanged(NewValue As Object) Handles ClientCallback .ValueChanged MessageBox.Show("Entered ValueChanged") End Sub
Eventhough the dispid ('1') is defined explicitly in the event in the IDL we call 'GetDispIdOfNames' with the name 'ValueChanged' to retrieve the actual dispid defined in the client before firing (Invoke) it.
If we run the client code in .NET versions up to (an including) 3.5 the 'GetDispIdOfNames' returns '1' as expected. When running exactly the same code in VB.NET 4.0 the 'GetDispIdOfNames' returns a HRESULT error 'E_NOTIMPL'. If I just neglect this error
and 'Invoke' dispid '1' explicitly the client eventhandler routine is called.
Is 'GetDispIdOfNames' no longer implemented in VB.NET 4.0 (or .NET 4.0 alltogether) clients and are there other COM interop incompatibilities to be expected?
Any feedback to deepen my understanding of this problem or get 'under the hood' info is very much appreciated.