Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
[DllImport("DK_V2.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]

//C++
      int GetUs(void* con, uint32_t devId, char** ubjs, uint32_t* nid);

I convert above function to c# code as follow :

 extern public static int GetUs(IntPtr con,out int devId,[MarshalAs(UnmanagedType.AnsiBStr), In] ref string ubjs, out int nid);

but that's wrong.

What I have tried:

I changed function variable datatypes but confront an error.
Posted
Updated 10-Sep-18 3:35am
Comments
CHill60 10-Sep-18 5:34am    
What is the error?
bernova 10-Sep-18 11:32am    
Null Pointer Error, marshaling char** is wrong

1 solution

Check this CodeProject post!

Marshalling with C#
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900