views:

46

answers:

0

Hello everyone,

i have a problem with COM objects and triggering events. I have:

  • a DLL written in C#.NET (3.5), which triggers events
  • an application in Delphi5, which uses the DLL as a COM object.

So far so good. Events go like this: - in the DLL there are 2 events. One is internal and is not COM-visible. The second one is external and is visible by COM - there is also a OnChanged function in the DLL, which is connected to the internal event and triggers the external event. So basically everytime the internal event is trigger, so is the external event. - this OnChanged function is also COM-visible and can be called from the Delphi app

I used this solution to get the whole thing working, I can successfully bind a Delphi procedure to the .NET event, but there's a catch: - if I call OnChanged from the Delphi app, everything's peachy - the binded Delphi function will get executed as well as (obviously) the .NET function - if the DLL calls OnChanged from a callback function in .NET, the binded Delphi function will NOT get executed.

Bottomline: if I trigger the external event from Delphi, everything is OK. If the DLL triggers the internal event, nothing will happen in Delphi (although for sure the external event is triggered).

Any ideas are highly appreciated!