Click to See Complete Forum and Search --> : const CList or array


rudyloo
June 13th, 2008, 12:46 PM
Hi,

I need to create a list or array of CStrings within a function that will stay in memory next time I come into the function.

I tried:



CString groupFound = "tempGroup"

const CList <CString, CString> myGroups;

myGroups.Addtail ( groupFound );



I get the following error:

error C2663: 'AddTail' : 2 overloads have no legal conversion for 'this' pointer

Any ideas?

thanks

Plasmator
June 13th, 2008, 12:56 PM
I need to create a list or array of CStrings within a function that will stay in memory next time I come into the function.
You're looking for the keyword static.

error C2663: 'AddTail' : 2 overloads have no legal conversion for 'this' pointerWhat did you expect? AddTail is a non-const function -- you, on the other hand, are trying to invoke it on a const object.

Other than that, this isn't really the right forum for MFC stuff...

rudyloo
June 13th, 2008, 01:03 PM
thanks