I have a dll that is written in c++. And I am p/invoking to call the functions.
I have this c++ declaration.
1-
__declspec(dllexport) bool dll_registerAccount(bool spot, unsigned char* Key,int Length, unsigned char* Source, unsigned char* Target);
2-
__declspec(dllexport) unsigned char MD5(unsigned char *InPut,uint4 Input_Length,unsigned char *OutPut);
I have done this dllimport declaration:
1-
[DllImport("nvsreg.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern bool dll_registerAccount(bool spot, [MarshalAs(UnmanagedType.LPStr)]string Key, int Length, [MarshalAs(UnmanagedType.LPStr)]string Source, [MarshalAs(UnmanagedType.LPStr)]string Target);
2-
[DllImport("nvsreg.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern string MD5([MarshalAs(UnmanagedType.LPStr)]string InPut,long Input_Length, [MarshalAs(UnmanagedType.LPStr)]string OutPut);
Would my DllImport be the equivalent to the c++ ?
please tell me what would be dllimport declaration.
Many thanks for any advice,