dalijap / nx-horizon

NX Horizon - Event Bus for Delphi
MIT License
116 stars 20 forks source link

Is this supposed to work with an Office add-in (DLL, ActiveX)? #5

Closed edwinyzh closed 1 year ago

edwinyzh commented 1 year ago

Thanks for the recent update.

Is nx-horizon event bus supposed to work with an Office add-in which is actually a DLL/ActiveX? Last time I tried it didn't work. If it's supposed to work, I'd like to try again.

Thanks.

dalijap commented 1 year ago

No, it will not work in a DLL.

DLLs cannot share RTTI information which is used in NX Horizon for distinguishing different event types.

https://docwiki.embarcadero.com/RADStudio/en/When_to_Use_Packages_and_DLLs

To support DLLs, code bus code would have to be different and use only COM shareable information. That means supported event types could only be interfaces with GUID and GUID would have to be used for subscribing, storing subscription information and dispatching events.

Existing code could (I cannot say whether there would be some additional issues in such modification) be modified to support such messaging, but then it would be a different specialized event bus.

edwinyzh commented 1 year ago

Thanks for the explanation, I got it. It's a pity, since nx horizon is such a simple but powerful event bus!