1

I have one Method called GetUser() in my C++ dll.

int GetUser(char *cUserid, USERINFO **pUserInfo); // C++

USERINFO is a structure which contains UserInformation Now when i consume this dll in C# the above API Looks like :

int GetUser(string bstrUserId,IntPtr USERINFO); // C#

Now the Problem is How to Pass this IntPtr in C# to get the User data of that UserID. Thanks in Advance.

Bokambo
  • 3,856
  • 22
  • 72
  • 108

1 Answers1

0

You could use Marshal.PtrToStructure to get a structure from an IntPtr. See this example.

You might also be able to replace the IntPtr type by your structure type (depending on how your structure looks like).

Community
  • 1
  • 1
ken2k
  • 46,953
  • 10
  • 113
  • 166