473,581 Members | 3,049 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

A collection of Objects?

RSH

Is there a way to iterate through all of the active objects in memory? Or
do I need to add the objects to a collection upon instantiation and do it
that way?

Ron
Dec 15 '05 #1
5 1025
What are you trying to accomplish with this?

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
You can lead a fish to a bicycle,
but it takes a very long time,
and the bicycle has to *want* to change.

"RSH" <wa************ *@yahoo.com> wrote in message
news:O0******** ******@TK2MSFTN GP12.phx.gbl...

Is there a way to iterate through all of the active objects in memory? Or
do I need to add the objects to a collection upon instantiation and do it
that way?

Ron

Dec 15 '05 #2
RSH
I can tell by your response that this is not a recommended practice.

I will look for a better approach.
"Kevin Spencer" <ke***@DIESPAMM ERSDIEtakempis. com> wrote in message
news:OO******** ********@TK2MSF TNGP15.phx.gbl. ..
What are you trying to accomplish with this?

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
You can lead a fish to a bicycle,
but it takes a very long time,
and the bicycle has to *want* to change.

"RSH" <wa************ *@yahoo.com> wrote in message
news:O0******** ******@TK2MSFTN GP12.phx.gbl...

Is there a way to iterate through all of the active objects in memory?
Or do I need to add the objects to a collection upon instantiation and do
it that way?

Ron


Dec 15 '05 #3
Hi,
"RSH" <wa************ *@yahoo.com> wrote in message
news:O0******** ******@TK2MSFTN GP12.phx.gbl...

Is there a way to iterate through all of the active objects in memory? Or
do I need to add the objects to a collection upon instantiation and do it
that way?


No, the GC does ont provide nothing that let you iterate through all the
objects currently instantiated in the heap ( not even speaking of those in
the stack )

What are you trying to do?

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
Dec 15 '05 #4
"RSH" <wa************ *@yahoo.com> a écrit dans le message de news:
O0************* *@TK2MSFTNGP12. phx.gbl...

| Is there a way to iterate through all of the active objects in memory? Or
| do I need to add the objects to a collection upon instantiation and do it
| that way?

You would never want to iterate through *all* the active objects in memory,
that would *really* take some time :-))

If you want to iterate through all the objects of one particular type, then
that would make more sense and, yes you would add them to a collection
rather than having a vast number lying around in disparate places in your
code; some of which could well be out of scope to the place that you want to
iterate them from.

What kind of reason do you have in mind for wanting to do this ?

Joanna

--
Joanna Carter [TeamB]
Consultant Software Engineer
Dec 15 '05 #5
Well, if you could tell us your requreiments, we could suggest some possible
solutions.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
You can lead a fish to a bicycle,
but it takes a very long time,
and the bicycle has to *want* to change.

"RSH" <wa************ *@yahoo.com> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
I can tell by your response that this is not a recommended practice.

I will look for a better approach.
"Kevin Spencer" <ke***@DIESPAMM ERSDIEtakempis. com> wrote in message
news:OO******** ********@TK2MSF TNGP15.phx.gbl. ..
What are you trying to accomplish with this?

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
You can lead a fish to a bicycle,
but it takes a very long time,
and the bicycle has to *want* to change.

"RSH" <wa************ *@yahoo.com> wrote in message
news:O0******** ******@TK2MSFTN GP12.phx.gbl...

Is there a way to iterate through all of the active objects in memory?
Or do I need to add the objects to a collection upon instantiation and
do it that way?

Ron



Dec 15 '05 #6

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

Similar topics

18
5733
by: Scott | last post by:
I have a collection where the items in the collection are dates. I want to iterate over the collection and build a value list string for the rowsource of a listbox. The dates in the collection are not in chronological order. Is there a way to first sort the collection and put the dates in chronological order before creating the value list...
10
1701
by: aa7im | last post by:
I have a similiar thread going about this topic but I decided to break it off into a seperate discussion. Question: What is the best way to determine if an object "IsNew" to a collection? Problem: In my application I load a collection of objects from the database and then pass that collection to the user.
6
1616
by: Mel | last post by:
I have a large collection of custom objects, each representing a period in time with each having a start datetime and an end datetime. I frequently need to query this collection to return a subset of the objects that fall completely or partially between two specified dates. The way I'm doing this at the moment is to iterate thru the entire...
3
1083
by: JJ | last post by:
Hi, I noticed in a sample app source code that the app made use of a class for example a user class and then had the user objects that got created stuffed into a user collection. I was wondering why do they do this if the user object that was created existed for the life of the object why u would need a user collection? I would think u...
5
2270
by: | last post by:
Trying to learn about manipulating collections of objects, and populating these objects dynamically from datasources. Could someone post a code sample that shows the following: Instantiating a collection object -- say, a dictionary. Populating that collection object with custom objects, say, Person. What I really want to see is how to...
1
1242
by: Pi | last post by:
I'm looking at a piece of code that gets called over 100,000 times and was wondering if there would be much performance difference between these three scenarios or is there an alternate approach?: == Scenario 1: == Dim colA as new Collection 'Collection of clsA objects <Add 10-20 clsA objects to colA collection>
10
2760
by: Chet Cromer | last post by:
I am creating a set of base classes and sub classes to use throughout a program I'm developing. The base class represents a generic "lookup table" from my database that contains lists of things like manufacturers, makes, modes, etc. of cars. I have created a generic "datacollection" class and a generic "dataobject" class to represent the...
3
2974
by: Dave | last post by:
Please - anyone that can help. I am getting confusing results while trying to expose a collection from a web service. I have a webservice in which a web method accepts a collection as a parameter and returns an array of datasets. The collection consists of database connection objects. Based on the simple hierarchy below, you can see...
19
4902
by: Jamey Shuemaker | last post by:
I'm in the process of expanding my knowledge and use of Class Modules. I've perused MSDN and this and other sites, and I'm pretty comfortable with my understanding of Class Modules with the exception of custom Collection Classes. Background: I'm developing an A2K .mdb to be deployed as an .mde at my current job-site. It has several custom...
158
7764
by: pushpakulkar | last post by:
Hi all, Is garbage collection possible in C++. It doesn't come as part of language support. Is there any specific reason for the same due to the way the language is designed. Or it is discouraged due to some specific reason. If someone can give inputs on the same, it will be of great help. Regards, Pushpa
0
7886
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7809
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
8159
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
8183
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...
0
6569
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5685
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
5366
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
1413
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1147
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.