J
Jeffrey Walton
Hi All,
I'm working on a VB program that calls into a C++/Crypto++ dll. The
Crypto++ and the Dll makes heavy use of size_t, so factoring out the
size_t is not an option.
In VB, I need an array of a known size. VB has a perverted behavior of
Dim'ing size+1 rather than size. So I'm stuck when allocating the
array
C++/Crypto++ pseudo code declaration:
size_t GetRequiredSize();
Visual Basic:
UintPtr size = GetRequiredSize()
Dim arr(0 To size-1) as Byte
Attempting to allocate the array causes Error BC30452: Operator '-' is
not defined for types 'System.UIntPtr' and 'Integer'.
I can't use an Integer since Integers are 4 bytes on both x86 and x64
platforms. The following compiles, but the Length is wrong (off by
one);
Dim arr(maxsize) As Byte
Any ideas?
Thanks,
Jeffrey Walton
I'm working on a VB program that calls into a C++/Crypto++ dll. The
Crypto++ and the Dll makes heavy use of size_t, so factoring out the
size_t is not an option.
In VB, I need an array of a known size. VB has a perverted behavior of
Dim'ing size+1 rather than size. So I'm stuck when allocating the
array
C++/Crypto++ pseudo code declaration:
size_t GetRequiredSize();
Visual Basic:
UintPtr size = GetRequiredSize()
Dim arr(0 To size-1) as Byte
Attempting to allocate the array causes Error BC30452: Operator '-' is
not defined for types 'System.UIntPtr' and 'Integer'.
I can't use an Integer since Integers are 4 bytes on both x86 and x64
platforms. The following compiles, but the Length is wrong (off by
one);
Dim arr(maxsize) As Byte
Any ideas?
Thanks,
Jeffrey Walton