Home All Groups Group Topic Archive Search About

.Net DLL only accepts ByteArray(1 to 32)

Author
13 Apr 2005 10:47 AM
Benjamin Lukner
Hi!

I'm using a .Net DLL that's referenced in my project.
The strange thing is that the DLL vendor uses byte arrays of 32 bytes
length to read and write data that have a lower bound of 1!

The only way I've found to create such an array is

Dim aData As System.Array = _
System.Array.CreateInstance( _
GetType(System.Byte), _
New Integer() {32}, _
New Integer() {1})

Does anyone know a neater way to do it?


Kind regards,

Benjamin Lukner

Author
13 Apr 2005 4:18 PM
Herfried K. Wagner [MVP]
Benjamin,

"Benjamin Lukner" <Benjamin.Lukner_at_trinomix***@mp3mounter.de> schrieb:
> I'm using a .Net DLL that's referenced in my project.
> The strange thing is that the DLL vendor uses byte arrays of 32 bytes
> length to read and write data that have a lower bound of 1!

Mhm...  Are you sure this is a .NET DLL?!

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>
Author
13 Apr 2005 5:13 PM
Benjamin Lukner
Herfried K. Wagner [MVP] wrote:
>> I'm using a .Net DLL that's referenced in my project.
>> The strange thing is that the DLL vendor uses byte arrays of 32 bytes
>> length to read and write data that have a lower bound of 1!
> Mhm...  Are you sure this is a .NET DLL?!

Yes, I'm sure.
But it seems to be a very simple wrapper around a COM Control that can
be used with VB6. I don't know why the vendor decided to use an array
that begins at 1. And why building another wrapper instead of a "real"
DLL. You know, the COM Control itself is already a wrapper around the
base API DLL.

Benjamin