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*,EERe cordVector *> EERecordList;
suppose in a method like
EERecordList CTest :: testMethod( )
{
EERecordList reclist;
EERecordVector *RecordVector =new EERecordVector();
RecordVector->Action = 'a';
RecordVector->Record = "test record";
reclist.AddTail(RecordVect or); //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.......
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*,EERe
suppose in a method like
EERecordList CTest :: testMethod( )
{
EERecordList reclist;
EERecordVector *RecordVector =new EERecordVector();
RecordVector->Action = 'a';
RecordVector->Record = "test record";
reclist.AddTail(RecordVect
return (reclist) //need to return the CList
}
I call the method as
CTest test;
EERecordList recs = test.testMethod();
this throws error.....
can anyone suggest.......
Can it be CList& or CList* as well?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Sorry, first line in function should read:
EERecordList* preclist = new EERecordList;
EERecordList* preclist = new EERecordList;
ASKER
thanks ...it works