CodeFusionMobile CodeFusionMobile - 6 months ago 29
Vb.net Question

How to pass integer as unsigned parameter in VB.NET?

I'm using a library call,

setInstance(ByVal instance As UInteger)
, in my VB.NET code. The parameter I need to pass is an
Integer
. Is there anything I need to do to convert the integer parameter to an unsigned integer? The number is guaranteed to be positive and less than 10.

Answer

Like so...

Dim MyInt As Int32 = 10
Dim MyUInt As UInt32 = CUInt(MyInt)
setInstance(MyUInt)