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

type info from a non-instantiated class

Does anyone here know how to get the type from a variable representing a
non-instantiated class? Something like this....

Dim a As MyClass
Dim t As System.Type = GetType(a)

Interestingly, GetType(MyClass) works just fine, but using a variable in
it's place will not.
Dec 27 '06 #1
2 1012
a.GetType()

I responded to your other thread as well.

Karl
--
http://www.openmymind.net/
http://www.codebetter.com/
"Random" <ci*******@hotmail.comwrote in message
news:OL*************@TK2MSFTNGP03.phx.gbl...
Does anyone here know how to get the type from a variable representing a
non-instantiated class? Something like this....

Dim a As MyClass
Dim t As System.Type = GetType(a)

Interestingly, GetType(MyClass) works just fine, but using a variable in
it's place will not.
Dec 28 '06 #2
Thanks again. The reason this didn't work is because the class was
uninstantiated. GetType() throws an error if you don't actually have an
instance of the class if you're using a variable to represent it.

"Karl Seguin" <ka********@removeopenmymindremovemetoo.andmenetwr ote in
message news:%2****************@TK2MSFTNGP02.phx.gbl...
a.GetType()

I responded to your other thread as well.

Karl
--
http://www.openmymind.net/
http://www.codebetter.com/
"Random" <ci*******@hotmail.comwrote in message
news:OL*************@TK2MSFTNGP03.phx.gbl...
>Does anyone here know how to get the type from a variable representing a
non-instantiated class? Something like this....

Dim a As MyClass
Dim t As System.Type = GetType(a)

Interestingly, GetType(MyClass) works just fine, but using a variable in
it's place will not.

Dec 28 '06 #3

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

Similar topics

1
by: Geoff Biggs | last post by:
Evening all, I'm trying to add a new built-in number data type to Python with its own syntax, so I'm working directly with the interpreter rather than creating my own extension module (side...
10
by: Greener | last post by:
Hi, I need help badly. Can you do client-side programming instead of server-side to capture the Browser type info? If this is the case, what's wrong with the following? <script...
4
by: Chris | last post by:
I'm wondering what is the "best" way to structure a set of info about an item, like a book or a hotel. Eg, let's say you had this info to present for each book in a collection: Title Author...
2
by: lawren | last post by:
Students interested may contact directly.
11
by: Robin Tucker | last post by:
I have a COM object, which implements straightforwardly the IDataObject interface. It seems this isn't the same IDataObject interface we now have with .NET. Basically, the COM object implements...
4
by: cwdjrxyz | last post by:
Take a look at http://www.explorerdestroyer.com/ and view the script used to detect IE. It uses quite a maze of elaborate script that examines user agents and many properties of a browser. Of...
16
by: Martin Jørgensen | last post by:
Hi, Short question: Any particular reason for why I'm getting a warning here: (cast from function call of type int to non-matching type double) xdouble = (double)rand()/(double)RAND_MAX;
0
by: selacika | last post by:
Hi all; My question is about how to get non-font information part of a field of text data type using an sql sentence. Shortly how to get pure info from a text data type field. Example: Value of...
2
by: Ian825 | last post by:
I need help writing a function for a program that is based upon the various operations of a matrix and I keep getting a "non-aggregate type" error. My guess is that I need to dereference my...
4
by: David Thielen | last post by:
We need this both for what we set in IIS and for the HttpContext.Reponse.ContentType property. We've tried a bunch of different things and none seem to work. thanks - dave ...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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.