Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / Win API / September 2007



Tip: Looking for answers? Try searching our database.

VB6 equivalent of C# uint

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Articulate - 19 Sep 2007 00:04 GMT
Hi,
What is the VB6 equivalent of C# uint?

Thx
Bob Butler - 19 Sep 2007 00:07 GMT
> Hi,
> What is the VB6 equivalent of C# uint?

VB6 does not support unsigned integers; depending on what you need to do
with it there are various workarounds.
Karl E. Peterson - 19 Sep 2007 00:07 GMT
> What is the VB6 equivalent of C# uint?

Closest to that would be a Long.  You just need to ignore the sign-bit.  (Think in
hex, if it helps.)
Signature

.NET: It's About Trust!
http://vfred.mvps.org

Thorsten Albers - 19 Sep 2007 00:15 GMT
Articulate <Articulate@discussions.microsoft.com> schrieb im Beitrag
<5973EDA8-3B26-40A8-9D66-4E09449D3A18@microsoft.com>...
> What is the VB6 equivalent of C# uint?

There is no equivalent data type in VB. C# uint is an unsigned integer of 4
bytes memory width with a value range from 0 to 4294967295. The VB data
type most appropriate is Long which has also 4 bytes memory width but is
signed, i.e. it has a value range from -2147483648 to 2147483647.
If you just want to store the 4 bytes you may use a Long. But if you want
to display the value as a decimal number, or if you want to calculate with
the value you have to convert the value to a data type with an appropriate
value range, e.g. a Double.

Signature

----------------------------------------------------------------------
THORSTEN ALBERS                       Universität Freiburg
                                               albers@
                                                      uni-freiburg.de
----------------------------------------------------------------------

MikeD - 19 Sep 2007 01:22 GMT
> Hi,
> What is the VB6 equivalent of C# uint?

And BTW, this has nothing to do the WinAPI. You happened to have gotten
decent answers, but you stand a better chance of getting answers if you post
to the proper newsgroup. If your message is off-topic, some people (perhaps
the very ones to best help you) are going to ignore it, even if they could
answer it.

Just something to keep in mind in the future.

Signature

Mike
Microsoft MVP Visual Basic

Michael C - 19 Sep 2007 01:58 GMT
> And BTW, this has nothing to do the WinAPI. You happened to have gotten
> decent answers, but you stand a better chance of getting answers if you
[quoted text clipped - 3 lines]
>
> Just something to keep in mind in the future.

Maybe it is appropriate as the OP is likely calling an API. In which case
it's ok to use a long in 99% of cases.

Michael
Jim Carlock - 19 Sep 2007 14:12 GMT
"Michael C" wrote...
: Maybe it is appropriate as the OP is likely calling an API. In
: which case it's ok to use a long in 99% of cases.

I won't ask which 99% that represents. So I will ask which 1% is
it not ok? Or is it less than 1%? Is there one call that fails?
:-)

Signature

Jim Carlock
North Carolina Swimming Pool, Spa And Water Feature Contractors
http://www.aquaticcreationsnc.com/

Karl E. Peterson - 19 Sep 2007 21:00 GMT
> "Michael C" wrote...
>> Maybe it is appropriate as the OP is likely calling an API. In
[quoted text clipped - 3 lines]
> it not ok? Or is it less than 1%? Is there one call that fails?
> :-)

I'd say that's open to interpretation. <rimshot />
Signature

.NET: It's About Trust!
http://vfred.mvps.org

Michael C - 24 Sep 2007 03:05 GMT
> I won't ask which 99% that represents. So I will ask which 1% is
> it not ok? Or is it less than 1%? Is there one call that fails?
> :-)

Most of the time the return value will be a handle or a return value that is
a const (eg an error indicator). In those cases it won't matter. In some
cases it will indicate a length but even then in most cases it won't matter
that it is limited to 2 billion.

Michael
MikeD - 19 Sep 2007 23:05 GMT
>> And BTW, this has nothing to do the WinAPI. You happened to have gotten
>> decent answers, but you stand a better chance of getting answers if you
[quoted text clipped - 6 lines]
> Maybe it is appropriate as the OP is likely calling an API. In which case
> it's ok to use a long in 99% of cases.

The OP didn't give ANY indication he was using the *Windows* API....and
that's what this newsgroup is for.

Signature

Mike
Microsoft MVP Visual Basic

Karl E. Peterson - 19 Sep 2007 23:33 GMT
>>> And BTW, this has nothing to do the WinAPI. You happened to have gotten
>>> decent answers, but you stand a better chance of getting answers if you
[quoted text clipped - 9 lines]
> The OP didn't give ANY indication he was using the *Windows* API....and
> that's what this newsgroup is for.

Hard to believe I'm agreeing with Michael C <g>, but I sense he's giving the benefit
of the doubt to OP, thinking this to be a given and hence the posting in this group.
I can see the logic in that.  Guy reading the API docs, wants to make a call, no
obviously comparable datatype.  But then, the Subject sorta screws up that kindness.
Nah, Michael's definitely wrong.  Again. <bg>
Signature

.NET: It's About Trust!
http://vfred.mvps.org

Michael C - 24 Sep 2007 03:03 GMT
> Hard to believe I'm agreeing with Michael C <g>, but I sense he's giving
> the benefit of the doubt to OP, thinking this to be a given and hence the
> posting in this group. I can see the logic in that.  Guy reading the API
> docs, wants to make a call, no obviously comparable datatype.  But then,
> the Subject sorta screws up that kindness. Nah, Michael's definitely
> wrong.  Again. <bg>

I thought for once you were showing some sense. Likely the OP is is calling
an API in C# and want to do the same thing in VB6, or calling a C# function
which is going to be done via a declare.

Michael
Michael C - 24 Sep 2007 06:36 GMT
> Hard to believe I'm agreeing with Michael C <g>, but I sense he's giving
> the benefit of the doubt to OP, thinking this to be a given and hence the
> posting in this group. I can see the logic in that.  Guy reading the API
> docs, wants to make a call, no obviously comparable datatype.  But then,
> the Subject sorta screws up that kindness. Nah, Michael's definitely
> wrong.  Again. <bg>

Also, notice that I said he *might* be calling an API, therefore I am most
definately absolutely positively 100% correct in my statement. :-)

Michael
Articulate - 28 Sep 2007 04:15 GMT
My apologies.
I was working with window API. Basically my task was to process the custom
messages which were being sent by a C# app. The uint variable was part of the
structure being passed.

> > Hi,
> > What is the VB6 equivalent of C# uint?
[quoted text clipped - 6 lines]
>
> Just something to keep in mind in the future.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.