DLL example in Oxygene

后端 未结 2 1300
抹茶落季
抹茶落季 2021-01-26 00:03

Can somebody tell me where to find an example in how to make an DLL (WindowsControlLibrary) in Oxygene for .NET?
In the old Delphi, you make an export section.

2条回答
  •  不要未来只要你来
    2021-01-26 00:37

    If you whant to make it compatible with delphi then you have to indicate a "stdcall" Calling Convention

    namespace ClassLibrary2;

    interface

    type Class1 = public class

    private

    protected

    public

    [UnmanagedExport('ShowMessage'), System.Runtime.InteropServices.CallingConvention.StdCall]

    class method ShowMessage(aMsg : String); end;

    implementation

    class method Class1.ShowMessage(aMsg : String);

    begin

    System.Windows.Forms.MessageBox.Show(aMsg);

    end;

    end.

提交回复
热议问题