ARRAYs in VB.Net

  • Thread starter Thread starter Michael Fitzpatrick
  • Start date Start date
M

Michael Fitzpatrick

I have a DLL written in C. This DLL reads a text file and creates a several
very large arrays, 500,000 points and even larger. I would like the get the
data in VB.Net so that I can plot it. Presently I am creating an equally
sized array in VB and copying the data from the DLL's array into the VB
array.

There must be a better way. I looked into using a SAFEARRAY but it looks to
me that VB.Net doesn't use them as a native array structure.

Can I get the DLL's pointer to the array and use it in VB.Net?
Can I otherwise package the array in the DLL so that I do not need to
duplicate it?
 
Michael,

Just curious,

Why not just read the file straight from vb.net? And put in an array as you
read?
Seems like duplicate effort for nothing. Vb.net can read text files. Seems
to do a good job.

I suppose you could create and object or just use the classes/structs for
points in system.drawing and make a collection of them or array and then
serialize them.

Could put them all in a database and easily access also. Or do you need
these 500k points in an array in memory to draw some super shaped polygon?

I'm not graphics genious and new to .net--just a year or so using, but seems
you'd just read it using vb.net without the dll...

If am missing anything then please let me know.

Thanks,

Shane
 
The VB.Net program is just a UI for the DLL's and allows the user to select
the file to process and will get the data and plot it, so the VB is just a
shell for the real work being done in the C DLL's.

The DLL's are used in a test system. The data is read from a text file and
processed, so the arrays are not the data in the text file, but rather an
analysis of that data. C Dll's are used so that I can be platform
independent, that is, I need to be able to use this DLL code in other test
systems like National Instruments Labview and Agilent Vee.

I have the system working now, except that it is slower and uses more
resources because of the arrays, there are 30 in all. I usually duplicate 2
at a time, but now I find myself re-reading the same arrays several times
and I am looking for a way to improve performance.
 
Back
Top