469,904 Members | 2,143 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,904 developers. It's quick & easy.

IntPtr

Lou
What is the C# equivelent of the VB .Net "IntPtr"
i need to pass it to the File System object?
Nov 15 '05 #1
2 1892
System.IntPtr is a standard value type and works with all .NET languages.

--
Bob Powell [MVP]
C#, System.Drawing

The November edition of Well Formed is now available.
Learn how to create Shell Extensions in managed code.
http://www.bobpowell.net/currentissue.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/gdiplus_faq.htm

Read my Blog at http://bobpowelldotnet.blogspot.com

"Lou" <lo********@comcast.net> wrote in message
news:OY****************@TK2MSFTNGP10.phx.gbl...
What is the C# equivelent of the VB .Net "IntPtr"
i need to pass it to the File System object?

Nov 15 '05 #2
Bob and Lou,

It should be noted that if you are going to pass handles to unmanaged
code that are represented by managed constructs, you should use the
HandleRef structure instead. This will make sure that if the object is not
referenced anywhere else, it is not disposed of.

For example, if using the Graphics object, and you call GetHdc, you
should use a HandleRef structure instead of an IntPtr, so that when passed
to unmanaged code (a call to BitBlt perhaps), the Graphics instance won't be
collected by the GC if it isn't referenced anywhere.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Bob Powell [MVP]" <bob@_spamkiller_bobpowell.net> wrote in message
news:OL**************@TK2MSFTNGP12.phx.gbl...
System.IntPtr is a standard value type and works with all .NET languages.

--
Bob Powell [MVP]
C#, System.Drawing

The November edition of Well Formed is now available.
Learn how to create Shell Extensions in managed code.
http://www.bobpowell.net/currentissue.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/gdiplus_faq.htm

Read my Blog at http://bobpowelldotnet.blogspot.com

"Lou" <lo********@comcast.net> wrote in message
news:OY****************@TK2MSFTNGP10.phx.gbl...
What is the C# equivelent of the VB .Net "IntPtr"
i need to pass it to the File System object?


Nov 15 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Nuno Esculcas | last post: by
13 posts views Thread by Christian Westerlund | last post: by
10 posts views Thread by Tamir Khason | last post: by
2 posts views Thread by Alex Sedow | last post: by
6 posts views Thread by active | last post: by
reply views Thread by Jørn Jensen | last post: by
9 posts views Thread by pigeonrandle | last post: by
1 post views Thread by dcurington | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.