3F / DllExport

.NET DllExport with .NET Core support (aka 3F/DllExport aka DllExport.bat)
MIT License
940 stars 131 forks source link

Export Event Handling? #111

Closed Mr-Pearce closed 4 years ago

Mr-Pearce commented 5 years ago

Hi i would like to make a small c# (net4.72) dll that will connect to a web service. That whole thing has to be imported in Delphi (That part is easy so far and already working)

That dll will check stuff on the web service and trigger an event if something happens.

Is it possible to "DllExport" these events? I saw in your Conari project that c++ has also events.

Sorry if that question may sound stupid. I have no experience yet in that whole com import/export thing.

3F commented 5 years ago

P/Invoke doesn't support the .net events. Thus you can't export something like this.

However, the .net events just represents Observer pattern so you can implement this yourself including in unmanaged C++ part.

By the way, here's my old (copy-pasted from G+) short-article (with example on Java) for newbies: https://twitter.com/GitHub3F/status/1141444914812772352

Also! please note that mscoree does not implement "requesting" to an non cil managed code in the same manner like it could be for basic methods:

I saw in your Conari project that c++ has also events.

Conari really provides some events but this is CLR part. Or what events do you mean?