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

Thread: Using CArray

  1. #1
    Join Date
    Apr 1999
    Posts
    4

    Using CArray

    I have declared a CArray object embedded in the declaration of another CObject class - CDeclGood - which is similar to this:
    CArray<CDeclGoodTrad, CDeclGoodTrad&> TradList;
    My CDeclGoodTrad class contains 5 members m_....1, m....2 for example and so on.
    When I try to populate my memebrs with SetAt in the TradList array I obtain a typecast error.
    What am I doing wrong and how could I populate my elements in the list whereby some values are of long datatype and the others of CString?
    I would appreciate any help regarding this issue.


  2. #2
    Join Date
    Apr 1999
    Posts
    12

    Re: Using CArray

    Hi,

    to declare a typed pointer array you have to use:

    CTypedPtrArray <class CObArray, class CDealGoodTrad *> m_paGoodTrade;

    Now you can use

    m_paGoodTrade.Add(pDealGoodTrade);

    Regards,

    Bernd



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