Does anyone happen to have a snippet of [VB 2003] code that,
for a given Type, produces a list of [all] the properties, methods,
constructors, and so on for that Class?
TIA,
Phill W. 4 1135
"Phill. W" <P.A.Ward@o-p-e-n-.-a-c-.-u-k> schrieb: Does anyone happen to have a snippet of [VB 2003] code that, for a given Type, produces a list of [all] the properties, methods, constructors, and so on for that Class?
I do not have such a snippet, but creatint such a snippet should not be that
hard when using the 'Type' class and its methods.
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Phill,
Have you looked at the on-line help for System.Type? Specifically:
Type.GetMembers http://msdn.microsoft.com/library/de...mberstopic.asp
If want specific "types" of members instead of all members, try:
Type.GetPropert ies
Type.GetFields
Type.GetEvents
Type.GetMethods
Type.GetConstru ctors
Type.GetNestedT ypes
--
Hope this helps
Jay [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net
"Phill. W" <P.A.Ward@o-p-e-n-.-a-c-.-u-k> wrote in message
news:dl******** **@yarrow.open. ac.uk...
| Does anyone happen to have a snippet of [VB 2003] code that,
| for a given Type, produces a list of [all] the properties, methods,
| constructors, and so on for that Class?
|
| TIA,
| Phill W.
|
|
"Herfried K. Wagner [MVP]" <hi************ ***@gmx.at> wrote in message
news:Ow******** ******@TK2MSFTN GP10.phx.gbl... "Phill. W" <P.A.Ward@o-p-e-n-.-a-c-.-u-k> schrieb: Does anyone happen to have a snippet of [VB 2003] code that, for a given Type, produces a list of [all] the properties, methods, constructors, and so on for that Class? I do not have such a snippet, but creatint such a snippet should not be
that hard when using the 'Type' class and its methods.
Herfried,
You're right; it's /not/ that bad - at least up to a point.
I've successfully iterated all my constructors, methods and properties
(using the fairly obvious GetConstructors , GetMethods, GetProperties),
but how do I pull out any Enum's my class might expose?
TIA,
Phill W.
Phill,
You would need to use Type.GetNestedT ypes() to get any Enums (and other
types) that you may have nested inside another type.
FWIW: I rarely nest Enums inside of another type, rather I place them at
file scope either in with the primary type that uses them or in their own
file. Something like:
---x--- class1.vb ---x---
Public Enum Enum1
Value1
End Enum
Public Class Class1
...
End Class
---x---
---x--- Enum2.vb ---x---
Public Enum Enum2
Value1
End Enum
---x---
---x--- AnotherType.vb ---x---
Public Class AnotherType
...
End Class
---x---
--
Hope this helps
Jay [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net
"Phill. W" <P.A.Ward@o-p-e-n-.-a-c-.-u-k> wrote in message
news:dl******** **@yarrow.open. ac.uk...
| "Herfried K. Wagner [MVP]" <hi************ ***@gmx.at> wrote in message
| news:Ow******** ******@TK2MSFTN GP10.phx.gbl...
| > "Phill. W" <P.A.Ward@o-p-e-n-.-a-c-.-u-k> schrieb:
| > > Does anyone happen to have a snippet of [VB 2003] code that,
| > > for a given Type, produces a list of [all] the properties, methods,
| > > constructors, and so on for that Class?
| >
| > I do not have such a snippet, but creatint such a snippet should not be
| that
| > hard when using the 'Type' class and its methods.
|
| Herfried,
|
| You're right; it's /not/ that bad - at least up to a point.
| I've successfully iterated all my constructors, methods and properties
| (using the fairly obvious GetConstructors , GetMethods, GetProperties),
| but how do I pull out any Enum's my class might expose?
|
| TIA,
| Phill W.
|
| This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Phil Powell |
last post by:
Where can I find an online PHP form validator script library to use? I
have tried hacking the one here at work for weeks now and it's getting
more and more impossible to customize, especially now with form
elements that turn out to be arrays that have to be compared with one
another!
I have one form element, languages, a checkbox group. Beside each
checkbox is a dropdown, proficiency (which will become proficiency
alongside languages)....
|
by: Robert May |
last post by:
We have a VB6 COM component that I don't have control over. All of the
values are returned from method calls using byref parameters. They
frequently break binary compatibility, in fact, there are three different
versions of the component, one for dev, one for test, and one for
production, all of which are broken with each re-compile, which means I
can't use early binding and COM interop. Ugh.
Using InvokeMember, how do I get values...
|
by: someone |
last post by:
Suppose that I have a class in an assembly that is delivered to the user,
what can I do to change the class so that it doesn't break the
binary compatibility? That is, user application can run with recompiling
and relinking.
I know that if I define an interface, and only expose the interface but not
the class which implments the interface, I can add a data member to the
class without breaking the binary compatibility. If the class...
|
by: Steven T. Hatton |
last post by:
This is a purely *hypothetical* question. That means, it's /pretend/,
CP. ;-)
If you were forced at gunpoint to put all your code in classes, rather than
in namespace scope (obviously classes themselves are an exception to this),
and 'bootstrap' your program by instantiating a single application object
in main(), would that place any limitations on what you could accomplish
with your program? Are there any benefits to doing things that...
|
by: danny van elsen |
last post by:
hello all,
in my application, I want to save the state of a number of classes to disk: what would be the best way to do this?
right now, I'm hard coding the fields of the classes, but of course after
every change to the classes, I also have to adapt the 'save' method. Is there a better way, perhaps using some kind of reflection?
I've searched boost.org for reflection, but there don't seem to be ready made classes?
thanks for any...
| |
by: Alf P. Steinbach |
last post by:
The eighth chapter (chapter 2.1) of my attempted Correct C++ tutorial is now
available, although for now only in Word format -- comments welcome!
Use the free & system-independent Open Office if you don't have Word.
Classes
<url: http://home.no.net/dubjai/win32cpptut/w32cpptut_02_01.zip>
Introduces the C++ language feature used to define new types, namely
classes. The focus in on creating safe and reusable classes. As a main
|
by: vim |
last post by:
hello everybody
Plz tell the differance between binary file and ascii
file...............
Thanks
in advance
vim
|
by: heddy |
last post by:
I understand that reflection allows me to discover the metadata of a
class at runtime (properties, methods etc). What I don't understand is
where this is useful. For example:
If I am the sole author of an application, I already know the metadata
about my classes - I wrote them. And even if I did not - Let's say I
buy a 3rd party class lib, it will be documented for me with that lib.
If I am part of a dev team, the same is true - If...
|
by: Simon Woods |
last post by:
Hi
I have a dll ('dll-X') which runs on top of (dependent upon) several
other dlls.
My build environment has a folder structure
binaries
compat-libs
|
by: osama178 |
last post by:
Hi,
What does it mean for an object to be binary compatible? And why
aren't STL objects binary compatible? Any insights, links, resources
for further reading are greatly appreciated.
Thanks.
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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 launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
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 into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| | |