CodeFusionMobile CodeFusionMobile - 1 year ago 67
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 Source

Like so...

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