.net - C# Dll - export functions -


i trying create c# dll few exportable functions. want c++/unmanaged program load .dll , call particular exported function inside dll.

i'am using robert giesecke's unmanaged exports. doesn't seem work.

i ran unmanaged program in debugger , "loadlibrary()", when tries "getprocaddress(test_start)" call fails , returns zero.

this c# code:

    using system.runtime.interopservices;     using rgiesecke.dllexport;     using etc...;       namespace test_dll     {          public class class1          {                  [dllimport("kernel32.dll")]               public static extern intptr openprocess(int dwdesiredaccess, bool binherithandle, int dwprocessid);                [dllexport("test_start", callingconvention = callingconvention.cdecl)]               public static void test_start()               {                     messagebox.show("it works","yes");               }           }     } 

the .dll builds fine , cpu match (x86), unmanaged program can't export function address once c# dll has been loaded.

its pretty basic right now, i'm trying work. i'll need imports later on.

any please, documentation nuget package quite thin. thanks

hey doing fine.

weirdly robert giesecke's unmanaged exports ignores first export??

so exports created below 1 worked , recognised.

i checked cff explorer see valid exports, , first 1 there. left blank export on top.


Comments

Popular posts from this blog

jOOQ update returning clause with Oracle -

java - Warning equals/hashCode on @Data annotation lombok with inheritance -

java - BasicPathUsageException: Cannot join to attribute of basic type -