473,327 Members | 2,016 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,327 software developers and data experts.

Array of handles, how to

How does one make a gc class that contains an array of handles to an array of
X-type? // comments out what I am trying to do:

public ref class c0
{
private:
static System::UInt32 c0_uid;
System::Int32 ndx;
array<System::UInt32> ^ c01 ;
// array<System::UInt32^> ^ c02 ;

public:
c0(void);
~c0(void);
System::UInt32 get_c01(System::Int32);

c0::c0(void)
{ c01 = gcnew array< System::UInt32 >(0x10);
// c02 = gcnew array< System::UInt32^ >(0x10);

for (ndx=0;ndx<0x10;ndx++){
c01[ndx] = (c0_uid << 8) + ndx;
// c02[ndx] = &(c01[ndx]);

}
c0_uid++;
}
Jan 20 '06 #1
3 1110
Have you tried:

array<array<Uint32>^>^

Or:

array<array<String^>^>^

Unless I'm reading your request wrong.

--
Hope this helps
Jay [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net
"mwindham" <mw******@discussions.microsoft.com> wrote in message
news:E4**********************************@microsof t.com...
| How does one make a gc class that contains an array of handles to an array
of
| X-type? // comments out what I am trying to do:
|
| public ref class c0
| {
| private:
| static System::UInt32 c0_uid;
| System::Int32 ndx;
| array<System::UInt32> ^ c01 ;
| // array<System::UInt32^> ^ c02 ;
|
| public:
| c0(void);
| ~c0(void);
| System::UInt32 get_c01(System::Int32);
|
| c0::c0(void)
| { c01 = gcnew array< System::UInt32 >(0x10);
| // c02 = gcnew array< System::UInt32^ >(0x10);
|
| for (ndx=0;ndx<0x10;ndx++){
| c01[ndx] = (c0_uid << 8) + ndx;
| // c02[ndx] = &(c01[ndx]);
|
| }
| c0_uid++;
| }
Jan 20 '06 #2
Keeping it as simple as I can, I had wanted to store the handles("pointers")
in c02[ndx] for the c01[ndx] value.

"Jay B. Harlow [MVP - Outlook]" wrote:
Have you tried:

array<array<Uint32>^>^

Or:

array<array<String^>^>^

Unless I'm reading your request wrong.

--
Hope this helps
Jay [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net
"mwindham" <mw******@discussions.microsoft.com> wrote in message
news:E4**********************************@microsof t.com...
| How does one make a gc class that contains an array of handles to an array
of
| X-type? // comments out what I am trying to do:
|
| public ref class c0
| {
| private:
| static System::UInt32 c0_uid;
| System::Int32 ndx;
| array<System::UInt32> ^ c01 ;
| // array<System::UInt32^> ^ c02 ;
|
| public:
| c0(void);
| ~c0(void);
| System::UInt32 get_c01(System::Int32);
|
| c0::c0(void)
| { c01 = gcnew array< System::UInt32 >(0x10);
| // c02 = gcnew array< System::UInt32^ >(0x10);
|
| for (ndx=0;ndx<0x10;ndx++){
| c01[ndx] = (c0_uid << 8) + ndx;
| // c02[ndx] = &(c01[ndx]);
|
| }
| c0_uid++;
| }

Jan 20 '06 #3
| Keeping it as simple as I can, I had wanted to store the
handles("pointers")
| in c02[ndx] for the c01[ndx] value.
Why?

It appears you want an interior_ptr:

http://msdn2.microsoft.com/en-us/library/y0fh545k.aspx

Something like (fantasy syntax):

array<interior_ptr<Uint32>>^

However! an interior_ptr can only be declared on the stack (you cannot have
an array of them, as array's are on the heap).

interior_ptr is closely related to pin_ptr, which means it effectively pins
an object, remember the GC cannot move a pinned object... (read performance
ramifications).

--
Hope this helps
Jay [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net
"mwindham" <mw******@discussions.microsoft.com> wrote in message
news:B6**********************************@microsof t.com...
| Keeping it as simple as I can, I had wanted to store the
handles("pointers")
| in c02[ndx] for the c01[ndx] value.
|
| "Jay B. Harlow [MVP - Outlook]" wrote:
|
| > Have you tried:
| >
| > array<array<Uint32>^>^
| >
| > Or:
| >
| > array<array<String^>^>^
| >
| > Unless I'm reading your request wrong.
| >
| > --
| > Hope this helps
| > Jay [MVP - Outlook]
| > ..NET Application Architect, Enthusiast, & Evangelist
| > T.S. Bradley - http://www.tsbradley.net
| >
| >
| > "mwindham" <mw******@discussions.microsoft.com> wrote in message
| > news:E4**********************************@microsof t.com...
| > | How does one make a gc class that contains an array of handles to an
array
| > of
| > | X-type? // comments out what I am trying to do:
| > |
| > | public ref class c0
| > | {
| > | private:
| > | static System::UInt32 c0_uid;
| > | System::Int32 ndx;
| > | array<System::UInt32> ^ c01 ;
| > | // array<System::UInt32^> ^ c02 ;
| > |
| > | public:
| > | c0(void);
| > | ~c0(void);
| > | System::UInt32 get_c01(System::Int32);
| > |
| > | c0::c0(void)
| > | { c01 = gcnew array< System::UInt32 >(0x10);
| > | // c02 = gcnew array< System::UInt32^ >(0x10);
| > |
| > | for (ndx=0;ndx<0x10;ndx++){
| > | c01[ndx] = (c0_uid << 8) + ndx;
| > | // c02[ndx] = &(c01[ndx]);
| > |
| > | }
| > | c0_uid++;
| > | }
| >
| >
| >
Jan 24 '06 #4

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

Similar topics

2
by: gce | last post by:
What happens : When I first press the button, I get an listbox1 with a,b,c (correct: because of the addtoa(1, "a") addtoa(2, "b") addtoa(3, "c") When I check the checkbox, the eventhandler...
5
by: B | last post by:
Hello, I am trying to migrate a vb6 app to vb.net. In one piece of the vb6 app I have a label where the label backcolor changes every 5 seconds on a timer. So I created an array of colors as...
2
by: Len via DotNetMonster.com | last post by:
I have to set up a 2d array(13, 4) containing a deck of playing cards. What I am wondering is how to correctly set up the array in the first place, and then how do you access the information once...
8
by: Paul in Toronto | last post by:
Got this assignment in my VB .NET class. The program's basically a picture viewer that lets you add your pictures to an array so you can cycle through them once the file's been opened. So you...
4
by: Rich | last post by:
Hello, I have 3 textboxes and 1 combobox on a form. On entering the control I want to select all the text. I can make an array of textboxes like this: Dim arrTxt As TextBox() = {txt1, txt2,...
6
by: Rich | last post by:
Hello, I have an application that contains several checkboxes. I originally created this app in VB.Net 2003 and upgraded the app to VB.Net 2005. I understand the vb2005 supports control...
0
by: raypjr | last post by:
Hi everyone. I'm new here and hope I can get a little advice on how to list my array into a ListBox. I have my structure and array of structures. I need help with a For Loop that will list the...
2
by: raypjr | last post by:
Hi everyone. I'm new here and hope I can get a little advice on how to list my array into a ListBox. I have my structure and array of structures. I need help with a For Loop that will list the...
11
by: memeticvirus | last post by:
I have an array cli::array<float, 2and I would like to access a subset of it's values by compiling an array of pointers. But, it's not possible to create an array of type...
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: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
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...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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

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.