473,394 Members | 1,821 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,394 software developers and data experts.

ARRAYs in VB.Net

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 zf****@pbqrvafvtug.com is encrypted with www.rot13.org
Nov 20 '05 #1
2 1919
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" <mm*****@codeinsight.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
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 zf****@pbqrvafvtug.com is encrypted with www.rot13.org

Nov 20 '05 #2
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" <Th*******@TAKEOUTTHISSPAMBUSTERsofthome.net> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
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" <mm*****@codeinsight.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
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 zf****@pbqrvafvtug.com is encrypted with www.rot13.org


Nov 20 '05 #3

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

Similar topics

19
by: Canonical Latin | last post by:
"Leor Zolman" <leor@bdsoft.com> wrote > "Canonical Latin" <javaplus@hotmail.com> wrote: > > > ... > >But I'm still curious as to the rational of having type >...
21
by: Matteo Settenvini | last post by:
Ok, I'm quite a newbie, so this question may appear silly. I'm using g++ 3.3.x. I had been taught that an array isn't a lot different from a pointer (in fact you can use the pointer arithmetics to...
5
by: JezB | last post by:
What's the easiest way to concatenate arrays ? For example, I want a list of files that match one of 3 search patterns, so I need something like DirectoryInfo ld = new DirectoryInfo(searchDir);...
3
by: Michel Rouzic | last post by:
It's the first time I try using structs, and I'm getting confused with it and can't make it work properly I firstly define the structure by this : typedef struct { char *l1; int *l2; int Nval; }...
1
by: Rob Griffiths | last post by:
Can anyone explain to me the difference between an element type and a component type? In the java literature, arrays are said to have component types, whereas collections from the Collections...
41
by: Rene Nyffenegger | last post by:
Hello everyone. I am not fluent in JavaScript, so I might overlook the obvious. But in all other programming languages that I know and that have associative arrays, or hashes, the elements in...
6
by: Robert Bravery | last post by:
Hi all, Can some one show me how to achieve a cross product of arrays. So that if I had two arrays (could be any number) with three elements in each (once again could be any number) I would get:...
1
by: Doug_J_W | last post by:
I have a Visual Basic (2005) project that contains around twenty embedded text files as resources. The text files contain two columns of real numbers that are separated by tab deliminator, and are...
16
by: mike3 | last post by:
(I'm xposting this to both comp.lang.c++ and comp.os.ms- windows.programmer.win32 since there's Windows material in here as well as questions related to standard C++. Not sure how that'd go over...
29
weaknessforcats
by: weaknessforcats | last post by:
Arrays Revealed Introduction Arrays are the built-in containers of C and C++. This article assumes the reader has some experiece with arrays and array syntax but is not clear on a )exactly how...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.