By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,165 Members | 1,403 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,165 IT Pros & Developers. It's quick & easy.

UInt32 in VB.NET

P: n/a
Hi,

I am writing a Managed C++ class library where
interfaces take a unsigned int parameter. Looking at the
CTS documentation, it is mentioned that there is no built-
in type in VB.NET for this and System::UInt32 is to be
used. Now VB.NET does not even allow integer
literals/variables to be assigned to a UInt32 variabe.
Can somebody please explain the idea behind this and
what type should I use in interfaces ?

Thanks,
Shankar
Nov 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"Shankar" <sh********@rediffmail.com> schrieb
Hi,

I am writing a Managed C++ class library where
interfaces take a unsigned int parameter. Looking at the
CTS documentation, it is mentioned that there is no built-
in type in VB.NET for this and System::UInt32 is to be
used. Now VB.NET does not even allow integer
literals/variables to be assigned to a UInt32 variabe.
Can somebody please explain the idea behind this and
what type should I use in interfaces ?


If you want your interface to be CLS compliant and usable from VB.NET, you
must not use UInt32. However, I also wonder why UInt32 is not CLS compliant.
--
Armin

Nov 20 '05 #2

P: n/a
Hello,

"Shankar" <sh********@rediffmail.com> schrieb:
I am writing a Managed C++ class library where
interfaces take a unsigned int parameter. Looking at the
CTS documentation, it is mentioned that there is no built-
in type in VB.NET for this and System::UInt32 is to be
used. Now VB.NET does not even allow integer
literals/variables to be assigned to a UInt32 variabe.


Unsigned types are not CLS compliant. Don't use them in your interfaces.

--
Herfried K. Wagner
MVP VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.