PC Review


Reply
Thread Tools Rate Thread

ARRAYs in VB.Net

 
 
Michael Fitzpatrick
Guest
Posts: n/a
 
      27th Feb 2004
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?

--
: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
: my email address (E-Mail Removed) is encrypted with www.rot13.org


 
Reply With Quote
 
 
 
 
SStory
Guest
Posts: n/a
 
      27th Feb 2004
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

"Michael Fitzpatrick" <(E-Mail Removed)> wrote in message
news:%23ORiLlV$(E-Mail Removed)...
> 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?
>
> --
> : - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> : my email address (E-Mail Removed) is encrypted with www.rot13.org
>
>



 
Reply With Quote
 
Michael Fitzpatrick
Guest
Posts: n/a
 
      27th Feb 2004
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.

"SStory" <(E-Mail Removed)> wrote in message
news:%23MjaRRW$(E-Mail Removed)...
> 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
>
> "Michael Fitzpatrick" <(E-Mail Removed)> wrote in message
> news:%23ORiLlV$(E-Mail Removed)...
> > 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?
> >
> > --
> > : - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> > : my email address (E-Mail Removed) is encrypted with

www.rot13.org
> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Converting native arrays to managed arrays Bob Altman Microsoft VC .NET 8 27th Feb 2008 11:33 PM
Trouble with arrays (transferring values between two arrays) Keith R Microsoft Excel Programming 4 14th Nov 2007 12:00 AM
Jagged Arrays Problem - How to Assign Arrays to an Array Zigs Microsoft Excel Programming 3 11th Apr 2007 01:39 AM
Working with ranges in arrays... or an introduction to arrays =?Utf-8?B?R2xlbg==?= Microsoft Excel Programming 5 10th Sep 2006 08:32 AM
Arrays - declaration, adding values to arrays and calculation Maxi Microsoft Excel Programming 1 17th Aug 2006 04:13 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:58 AM.