Click here to Skip to main content
15,902,939 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear Developer,
I want to find the alternative of C# sbyte into vb6.
In C# Sbyte have the Range -127 to +128 .
I want to find same range array in VB6.
In VB6 there is byte array but its have range 0-255.
Is any alternative method in VB6 to find the same array Range like sbyte in c#?

Thanks in Advanced,
Regards,
Ravi Sharma
Posted

VB6 doesn't have an integer type that small. You're going to have to cast the value on the C# side to a Byte before passing it to your VB6 app, or change the type in the C# side to be a Byte instead of a SByte, (which I think would be a bit more tedious to do, but more maintainable in the long run). Another benefit is that you don't have to implement sanity checks on the C# side if the data is returned from the VB6 app (because the value being passed back may overflow the SByte variable on the C# side).
 
Share this answer
 
As far as I know VB6 hasn't the signed byte as built in type. Depending upon your needs you may store .NET SByte values into Bytes or use Integer instead.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900