|
-
June 13th, 2008, 12:46 PM
#1
const CList or array
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:
Code:
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
-
June 13th, 2008, 12:56 PM
#2
Re: const CList or array
 Originally Posted by rudyloo
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.
 Originally Posted by rudyloo
error C2663: 'AddTail' : 2 overloads have no legal conversion for 'this' pointer
What 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...
-
June 13th, 2008, 01:03 PM
#3
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|