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

Can I get a instance from type?

i konw a type(no class),can i get this type`s instance list?

Jul 21 '05 #1
7 2090
¿ÉÒÔ˵µÃÇå³þÒ»µãÂð£¿

type(no class)£¿Ê²Ã´Òâ˼£¿

--
ÁõÃô
Rustle Liu

http://www.cnblogs.com/rustle/

"ºù«µºÉÌÇæÈí¼þ£*ÕÅн¨" <Su********@sina.com> дÈëÏûÏ¢
news:e3**************@TK2MSFTNGP11.phx.gbl...
i konw a type(no class),can i get this type`s instance list?

Jul 21 '05 #2
ºÇºÇ£¬Ó¢Óï½Ï²î£¬
ÊÇÕâÑùµÄ£¬ÎÒÓÐÒ»¸ö¼Ì³Ð×ÔMarshalByRefµÄÀàSvcControl ler±»×¢²áΪSingleton.
ͬʱ£¬Õâ¸öÀàÔÚ±¾AppDomainÖпÉÄܱ»ÊµÀý»¯Á˶à´Î£¬

ÎÒÏÖÔÚÏëÖªµÀ£¬ÄĸöʵÀýÊDZ»Ô¶³ÌʵÀý»¯µÄ£¬È»ºóÎÒµ÷Óà Õâ¸ö±»Ô¶³ÌʵÀý»¯ ʵÀý µÄ·½
·¨£¬ÒÔ´¥·¢Ò»¸öʼþ֪ͨ¿Í»§¡£

²»Äܵ÷ÓÃËùÓÐʵÀýµÄ£¨ÒòΪÈç¹ûµ÷Óñ¾µØµÄʵÀý£¬»áÒýÆð ÏûÏ¢Ñ*»·£©¡£

Ôõô²ÅÄÜÅжÏÄĸöʵÀýÊDZ»Ô¶³ÌʵÀý»¯µÄÄØ£¿



"ÁõÃô" <ru********@hotmail.com.discuss> дÈëÓʼþ
news:Om**************@TK2MSFTNGP10.phx.gbl...
¿ÉÒÔ˵µÃÇå³þÒ»µãÂð£¿

type(no class)£¿Ê²Ã´Òâ˼£¿

--
ÁõÃô
Rustle Liu

http://www.cnblogs.com/rustle/

"ºù«µºÉÌÇæÈí¼þ£*ÕÅн¨" <Su********@sina.com> дÈëÏûÏ¢
news:e3**************@TK2MSFTNGP11.phx.gbl...
i konw a type(no class),can i get this type`s instance list?


Jul 21 '05 #3
Just a question. What encoding do you use for your messages? I am unable to see your text as the encoding isn't specified in the message.

--
Happy coding!
Morten Wennevik [C# MVP]
Jul 21 '05 #4
SIMPLE CHINESE GB2312

"Morten Wennevik" <Mo************@hotmail.com> ????
news:opr9ddfye1klbvpo@morten_x.edunord...
Just a question. What encoding do you use for your messages? I am unable to see your text as the encoding isn't specified in the message.
--
Happy coding!
Morten Wennevik [C# MVP]

Jul 21 '05 #5
Ah, well, I found a GBK/BG2312 encoding, which will output the text in Chinese, but since I don't know any Chinese beyond "ni hao" I guess it doesn't really matter :)

On Thu, 10 Jun 2004 16:31:14 +0800, ???????-??? <Su********@sina.com> wrote:
SIMPLE CHINESE GB2312

"Morten Wennevik" <Mo************@hotmail.com> ????
news:opr9ddfye1klbvpo@morten_x.edunord...
Just a question. What encoding do you use for your messages? I am unable

to see your text as the encoding isn't specified in the message.

--
Happy coding!
Morten Wennevik [C# MVP]



--
Happy coding!
Morten Wennevik [C# MVP]
Jul 21 '05 #6
Activator.CreateInstance(Type type)

--
cody

Freeware Tools, Games and Humour
http://www.deutronium.de.vu || http://www.deutronium.tk
"ºù«µºÉÌÇæÈí¼þ£*ÕÅн¨" <Su********@sina.com> schrieb im Newsbeitrag
news:e3**************@TK2MSFTNGP11.phx.gbl...
i konw a type(no class),can i get this type`s instance list?

Jul 21 '05 #7
No, you can not. There is no way to see what instances of a type exist
in the current app domain. You ^might^ be able to do this through the hooks
that the CLR provides, but I wouldn't recommend it.

If you need this information, I would recommend using a class factory
pattern, where you can keep track of the instances that are created and then
retrieve them when necessary.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"ºù«µºÉÌÇæÈí¼þ£*ÕÅн¨" <Su********@sina.com> wrote in message
news:e3**************@TK2MSFTNGP11.phx.gbl...
i konw a type(no class),can i get this type`s instance list?

Jul 21 '05 #8

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

Similar topics

4
by: Graeme Matthew | last post by:
Hi all, quick one, I hope I am explaining this properly, I am wanting to do some introspection on custom object instances, for example: import md5 >>> m = md5.new() >>> type(m) <type...
6
by: RT Lange | last post by:
>>> class E1(Exception): pass >>> class E2(E1): pass >>> i = E2('foo') >>> raise E1(i) Traceback (most recent call last): File "<pyshell#5>", line 1, in ? raise E1(i) E1: foo
1
by: Brad Clements | last post by:
I need to dynamically create a new type of class at runtime, based on an oldstyle class and a new style class. I'm using Python 2.3.2 My code: def shipment_from_db_instance(db_shipment):...
3
by: Steph | last post by:
Hi, On my first oracle instance, I have a global type 'productarray' (CREATE OR REPLACE TYPE productarray AS TABLE OF VARCHAR(30)), I have a package procedure having myArray OUT productarray as...
2
by: Andrzej Kaczmarczyk | last post by:
Hi, I have following problem: (warning, quite long post with lots of code) I have an object of a known type like this. class MyClass { public int Property1; public string Property2; }
10
by: John M. Gabriele | last post by:
The following short program fails: ----------------------- code ------------------------ #!/usr/bin/python class Parent( object ): def __init__( self ): self.x = 9 print "Inside...
3
by: wolfgang.lipp | last post by:
some time after posting my `Linkdict recipe`__ to aspn__ -- basically, a dictionary with run-time delegational lookup, but this is not important here -- i thought gee that would be fun to make...
2
by: TEK | last post by:
Hello We're having a issue with a part of our app that is very strange, and I'm unable to see that it should be possible. We have: A collection (ActivityCollection) that is inherited from a...
5
by: JH | last post by:
Hi I found that a type/class are both a subclass and a instance of base type "object". It conflicts to my understanding that: 1.) a type/class object is created from class statement 2.) a...
4
by: Gre7g Luterman | last post by:
I suppose I was lulled into complacency by how Python makes so many things look like classes, but I'm starting to realize that they're not, are they? I'm writing a C program which handles Python...
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?
0
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...
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...
0
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,...
0
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...

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.