简体   繁体   中英

Returning long pointer value from unmanaged DLL entry point

I have one entry point in my unmanaged DLL and this is the code from its C code

void *__cdecl entryp(int a1, int a2, __int64 a3, signed int a4, int a5)
{
  void *v6; 
  /..../
  /..../

  return v6;
}

and i use dllimport on my C# project with this

[DllImport("unmanaged.dll", EntryPoint = "entryp",CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe long* entryp(byte[] bData, uint length, ushort width, ushort heigth, uint nMaxCode, short anaLevel);

but the problem is the method just does not return anything whats going wrong with my code? Thanks for reading my question

The code in the DLL must be exported, so I'd expect the declaration to be:

void* __declspec(dllexport) entryp(int a1, int a2, __int64 a3, signed int a4, int a5)
{
  //...
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM