CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2008
    Posts
    78

    Get Name of struct variables and of its all parents

    Hi,

    I am having problems in retrieving names of variables of struct in a bottom up manner.

    For e.g. if my struct is:
    Code:
     struct NumberOfKids_t
     {
      int Daughters;
      int Sons;
     }
    
    struct Customer_t
    {
     string Name;
     string Age;
     NumberOfKids_t Childern;
    }
    
    Customer_t MyCustomer;
    It works fine if I try to retrive name of variables (using reflection) but it does not give me the complete name. For e.g.
    for variable Age in Customer_t, I get "Age" from MemberInfo, I wish here to get "MyCustomer.Name"
    Similarly, I try to retrive name of variable Sons, I get only Sons and I wish to retrieve "MyCustomer.Childern.Sons"

    Any idea how to do this.

    Thanks
    Ricky

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: Get Name of struct variables and of its all parents

    Post the code you are currently using.

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