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;
}