|
-
Feb 16th, 2005, 02:31 PM
#1
Thread Starter
New Member
IntPtr - C# to VB.NET
I am trying to convert the following C# code into VB.NET and am not able to convert integer to intptr in VB.NET.... Thanks for the help
int pEv = (int) tgData.pEventActivity;
Type typ = typeof(EVENTACTIVITYSTRUCT);
int size = Marshal.SizeOf( typ );
for(int i = 0; i < tgData.nEvents; i++ )
{
EVENTACTIVITYSTRUCT ev = (EVENTACTIVITYSTRUCT) Marshal.PtrToStructure( (IntPtr) pEv, typ );
textBox1.Text = textBox1.Text + ev.szEventNumber
pEv += size;
}
-
Feb 16th, 2005, 03:30 PM
#2
Re: IntPtr - C# to VB.NET
try using the IntPtr data type in VB
it also has a method .ToInt32 (or .ToInt16) to convert it to an integer
-
Feb 18th, 2005, 03:29 PM
#3
Thread Starter
New Member
Re: IntPtr - C# to VB.NET
kleinma,
Thanks a lot ... it worked ...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|