Convert from C# to VB

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi there,

I have the following code in C#.NET that I want to convert to VB.NET (don't
know why I can't):

MarshalEx.AllocHLocal(Marshal.SizeOf(typeof(ConnectionInfo)))

Can somebody help me?

Greetings, Cyberdot
 
Sorry, i ment this:

MarshalEx.AllocHLocal((uint)Marshal.SizeOf(typeof(ConnectionInfo)))

Greetings,
Cyberdot
 
Casting and getting a type instance is performed differently in VB -
GetType() is equivalent to typeof() and casting is done via the CType
method - this should work

MarshalEx.AllocHGlobal(CType(Marshal.SizeOf(GetType(ConnectionInfo)),UInt32))

Peter
 
Back
Top