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

Top 5 Contributors of the Month
david stephan
Gaurav Pal
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

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