Link to home
Start Free TrialLog in
Avatar of abi_a
abi_a

asked on

CList class object as return type

Hi,
  I need to have a CList object as return type. My code goes like this.

class EERecordVector
{
public:
      char Action;
      EERecord Record;
};

typedef CList<EERecordVector*,EERecordVector*> EERecordList;

suppose in a method like

EERecordList    CTest :: testMethod( )
{
    EERecordList   reclist;    
    EERecordVector *RecordVector =new EERecordVector();
    RecordVector->Action = 'a';
    RecordVector->Record = "test record";
    reclist.AddTail(RecordVector);   //keep on adding values like this
   return (reclist) //need to return the CList
}

I call the method as
CTest test;
EERecordList   recs = test.testMethod();

this throws error.....

can anyone suggest.......
Avatar of Member_2_1001466
Member_2_1001466

Can it be CList& or CList* as well?
ASKER CERTIFIED SOLUTION
Avatar of Member_2_1001466
Member_2_1001466

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Sorry, first line in function should read:

    EERecordList*   preclist = new EERecordList;
Avatar of abi_a

ASKER

thanks ...it works