CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Threaded View

  1. #1
    Join Date
    Nov 2006
    Posts
    357

    Reflection And Objects

    Hey,

    Just a quick question (hopefully), is there any way to loop round all the properties within an object?

    Its just ive got a function with an assembly object and would like to be able to spit out all its information onto the screen... so for example:

    m_Object.MyProperty1
    m_Object.MyProperty2
    etc...

    Rather than manually making a Dictionary object with the parameters and the values and having to manually populate it i was wondering if there was any way to extract the available properties associated with that object?

    Let me know if you want more clarity as it is a bit vauge, but basically i want to be able to get a list of strings that tells me all the properties an object has...

    MyProperty1, Property1Value
    MyProperty2, Property2Value
    etc...
    Last edited by Grofit; October 22nd, 2008 at 08:02 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured