Unmanaged Exports: Cannot compile assembly

后端 未结 4 1679
野趣味
野趣味 2020-12-16 07:15

I want to create a .NET assembly that can be accessed from unmanaged code (Delphi 5).

I have found Unmanaged Exports and followed the steps there but I am unable to

4条回答
  •  有刺的猬
    2020-12-16 08:05

    Just in case someone will meet the same problems...

    Some errors on my side:

    file: DllExportAttribute.cs

    public CallingConvention CallingConvention { get; set; }
    public string ExportName { get; set; }
    

    file: $projectname$.csproj

      
    
     
    

    Those are easy to fix.

    Here is one pretty serious. When making implib from resulting \x86\MyDll.dll - the name of dll in lib changes to \MyDll.dll ... you can make tdump MyDll.dll and will get in exports section "\MyDll.dll" instead of "MyDll.dll".

    Because of this problem dll can't be found by the soft that use resulting lib... in my situation it can be found only in c:\MyDll.dll

    Solved by making "coff2omf -lib:ca MyDll.lib" on the initial lib. But before that spent a day for looking solution...

提交回复
热议问题