473,321 Members | 1,748 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,321 software developers and data experts.

.Net DLL only accepts ByteArray(1 to 32)

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
Nov 21 '05 #1
2 936
Benjamin,

"Benjamin Lukner" <Be****************************@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/>
Nov 21 '05 #2
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
Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Kristina Engdahl | last post by:
Hello, I'm working with dynamic classloading and have encountered a problem when it comes to defining an URL for a file that is available through a bytearray representing a jar-file. The file in...
2
by: Lou | last post by:
How do I convert a byteArray to a string?
13
by: Ekim | last post by:
hy to all, I'm accessing a function from a managed-c++-dll within my c#-application. Therefore I encountered following troubles: In my c#-app I have got a byte-array, which should somehow be...
1
by: Daniel von Fersen | last post by:
When I want to Read the Bytes 1000-2000 from a Stream into a ByteArray using Stream.Read(byteArray,1000,2000) they are written to the positions 1000-2000 in the byteArray. but my Array is...
8
by: Daniel von Fersen | last post by:
When I want to Read the Bytes 1000-2000 from a Stream into a ByteArray using Stream.Read(byteArray,1000,2000) they are written to the positions 1000-2000 in the byteArray. but my Array is...
2
by: B-Dog | last post by:
I'm trying to download a csv file into a datatable but can't seem to figure it out. I can read the csv into a bytearray and view it but I'm having trouble trying to figure out get the downloaded...
2
by: BigC | last post by:
Hi, I am having problems converting from a Structure to a ByteArray. The main problem being that the structure contains a variable length array, which cannot be defined within the structure...
1
by: gijamie911 | last post by:
int nBytes = 256; byte ByteArray = new byte; int nBytesRead = inputStream.Read(ByteArray, 0 , nBytes); recorderID = ""; for (int i...
2
by: Brad Pears | last post by:
I have a bytearray variable and want to create a temporary file on my hard disk from this bytearray so I can print this data. How do I do this?? Thanks, Brad
11
by: Icemokka | last post by:
Hi, I'm need to upload a big file ( 600Mb+ ) to a BLOB field in MSSQL 2005. My code looks like this : fs = New FileStream(sFilePath, FileMode.Open) Dim ByteArray(fs.Length) As Byte...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.