Hi,
in our scenario we are using a delphi host and a .net plugin. The plugin is implemented as class factory, that means all plugin-methods return references on .net-objects. All the interfaces inherit from IHYCrossPlatformInterface. This mechanism is working very stable for a long time.
Now we have the following problem:
When we call a .net-object method from Delphi and pass an delphi-object as argument, we cannot call any method of this delphi-object from .net.
We get a InvalidCastException:
Unable to cast COM object of type ‘System.__ComObject’ to interface type ‘MyInterface’. This operation failed because the QueryInterface call on the COM component for the interface with IID ‘{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}’ failed due to the following error: Schnittstelle nicht unterstützt (Exception from HRESULT: 0x80004002 (E_NOINTERFACE))
The delphi-object implements IHYCrossPlatformInterface and the custom interface MyInterface and inherits from THYFakeIDispatch.
Is it possible to do calls back to delphi code this way or is casting the host property the only way?
Thanks,
Manuel