[fpc-pascal] Re: dll for C#

Elmar Haneke elmar at haneke.de
Mon Nov 28 09:57:47 CET 2011


> And one other thing I forgot, it must support classes.

You have to write an procedural wrapper around your class - each method 
gets an Procedure thar recieves the object as parameter and calls that 
object's method. These procedures are exported as stdcall as for an 
regular Windows DLL.

In C# you can write an class storing the FPC object as an IntPtr. The 
procedures from DLL are called using the P/Invoke mechanism.

Elmar



More information about the fpc-pascal mailing list