473,546 Members | 2,244 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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****@pbqrvafv tug.com is encrypted with www.rot13.org
Nov 20 '05 #1
2 1926
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*****@codein sight.com> wrote in message
news:%2******** ********@TK2MSF TNGP11.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****@pbqrvafv tug.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*******@TAKE OUTTHISSPAMBUST ERsofthome.net> wrote in message
news:%2******** ********@TK2MSF TNGP11.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*****@codein sight.com> wrote in message
news:%2******** ********@TK2MSF TNGP11.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****@pbqrvafv tug.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
2828
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 > >pointer-to-array-of-size-N-of-type-T (which is fine) and not having type > >array-of-size-N-of-type-T (with some exceptions, which is curious). > > So far > >the consensus seems to...
21
3900
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 "browse" it). So I expected that when I run this program, I get both c1.A and c2.A pointing to the same address, and changing c1.A means that also...
5
29235
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); pfiles = ld.GetFiles("*.aspx.resx|") + ld.GetFiles("*.ascx.resx") + ld.GetFiles("*.master.resx"); but of course there is no + operation allowed on...
3
2825
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; } *arrays; It's supposed to be a structure containing an array of chars, an array of ints and an int. I declare functions like this : arrays...
1
8691
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 Framework are said to have an element type. http://java.sun.com/docs/books/jls/second_edition/html/arrays.doc.html
41
4891
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 the hash are alphabetically sorted if the key happens to be alpha numeric. Which I believe makes sense because it allows for fast lookup of a key.
6
13146
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: the two arrays {"one","two","three"},{"red","green","blue} the result one red one green
1
2436
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 of different lengths (e.g. usually between 25 and 45 rows. The columns in each file have the same length). The text files have been numbered...
16
2514
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 at just comp.lang.c++. If one of these groups is too inappropriate, just take it off from where you send your replies.) Hi.
29
35403
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 multi-dimensional arrays work, b) how to call a function with a multi-dimensional array, c) how to return a multi-dimensional array from a function,...
0
7435
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7698
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7794
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5361
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3492
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3472
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1922
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1046
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
747
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.