C# Export function dll

自古美人都是妖i 提交于 2019-12-11 12:18:46

问题


I use the Unmanaged-Exports package from Robert Giesecke, which can be found at (https://sites.google.com/site/robertgiesecke/Home/uploads/unmanagedexports).

I'd like to export a function but somehow it doesn't work. The functions won't be exported.

My approach:

Code:

[DllExport("test", CallingConvention = CallingConvention.StdCall)]
    public static string test()
    {
        return "Hello World, this is the DLL";
    } 

Screenshot of my IDA results:

As you can see they're empty because no function was exported.


回答1:


Solution: http://www.codeproject.com/Articles/37675/Simple-Method-of-DLL-Export-without-C-CLI

Put the "DllExporter.exe" in your project folder.

German article: http://www.sotzny.de/2011/11/10/dllexport-net-ohne-ccli/



来源:https://stackoverflow.com/questions/31640912/c-sharp-export-function-dll

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!