I have a native regular C++ Dll which I want to call from C# code, so i created C++/CLI class (as described here and here) which will include managed C++ code and which can be called by any C# code directly and which can make calls inturn to native unmanaged C++.
One of function in native C++ dll has parameter of type int *. How do I declare in wrapper function and how can i convert it into int *?
IntPtr is a type that is roughly equivalent to void *.
From your comment, you’d be best off doing something like this (C#):
but since AllocHGlobal can take an int, I don’t know why you wouldn’t do this: