.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Imran Ghani
Post New Web Links

Do I need to pin?

Posted By:      Posted Date: April 10, 2011    Points: 0   Category :WPF
 

I have unmanaged funciton:

int fu1(char** buf);

I use following in C#:

static extern int fu1(ref IntPtr buf);

and I call it like:

byte[] mBuf;
IntPtr temp = IntPtr();
int size = fu1(ref temp);
mDuf = new byte[size];
Marshal.Copy(temp, mBuf, 0, size);

This works fine, but the question is - do I need to pin temp?




View Complete Post


More Related Resource Links

Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend