Dark Kai Posted January 14, 2004 Posted January 14, 2004 hi there, I was just wondering if this two are similar C++ int *pointer vb.net dim pointer as intptr BTW i dunno what is intptr. just know that it is suppose to be a pointer of some sort. Thanks in advance. Quote
*Experts* Bucky Posted January 14, 2004 *Experts* Posted January 14, 2004 IntPtr is a structure that is basically a strongly-typed Integer. It's meant for storing things like window handles and procedure addresses. It does not actually create a pointer that you can play around with. If you need to pass a pointer of a variable to a function, pass it regularly, but declare the parameter as ByRef in the method's signature. Quote "Being grown up isn't half as fun as growing up These are the best days of our lives" -The Ataris, In This Diary
Dark Kai Posted January 15, 2004 Author Posted January 15, 2004 oh ok... well then lets say i've a int variable Test dim Test as integer how do i get the address of this variable ? and how do i pass it in to the IntPtr ? Quote
Administrators PlausiblyDamp Posted January 15, 2004 Administrators Posted January 15, 2004 You could pass the integer by reference to a sub or function private sub DoThing(ByRef i as integer) end sub 'elsewhere you could use dim Test as integer DoThings(Test) 'This would pass a reference to Test to the sub. it may be easier if you give a better idea of what you are trying to do and why you feel you need pointers. [/code] Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Dark Kai Posted January 19, 2004 Author Posted January 19, 2004 well actually i'm trying to do a vertexbuffer rendering on CsGL. I need to pass in a IntPtr for my image buffer. I'm kindda stuck there so i thought it's better to understand IntPtr 1st. I would also appreciate if u know about vertexbuffer couze i know near nothing about how to implement it. thanks a lot. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.