Click here to Skip to main content
16,012,173 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Misbehaving StrList.AddTail(pStr[i]); (vc++6) Pin
Viorel.13-Jun-06 4:26
Viorel.13-Jun-06 4:26 
GeneralRe: Misbehaving StrList.AddTail(pStr[i]); (vc++6) Pin
Tara1413-Jun-06 4:38
Tara1413-Jun-06 4:38 
GeneralRe: Misbehaving StrList.AddTail(pStr[i]); (vc++6) Pin
Viorel.13-Jun-06 4:46
Viorel.13-Jun-06 4:46 
GeneralRe: Misbehaving StrList.AddTail(pStr[i]); (vc++6) Pin
Tara1413-Jun-06 4:51
Tara1413-Jun-06 4:51 
GeneralRe: Misbehaving StrList.AddTail(pStr[i]); (vc++6) Pin
Tara1413-Jun-06 5:11
Tara1413-Jun-06 5:11 
GeneralRe: Misbehaving StrList.AddTail(pStr[i]); (vc++6) Pin
Viorel.13-Jun-06 5:16
Viorel.13-Jun-06 5:16 
GeneralRe: Misbehaving StrList.AddTail(pStr[i]); (vc++6) Pin
Tara1413-Jun-06 5:22
Tara1413-Jun-06 5:22 
GeneralRe: Misbehaving StrList.AddTail(pStr[i]); (vc++6) Pin
Viorel.13-Jun-06 5:36
Viorel.13-Jun-06 5:36 
When you make a function like FillReportList(CStringList list) or FillReportList(int x), the system actually tries to make a copy of passed values (on the "stack"). Within the function, you work with the copy.

Copying is possible for int and other types, but is not possible for CStringList. This is because CStringList is a class which does not have a "copy constructor".

Disabling of copy operation for CStringList was decided by the authors, since frequently CStringList can have big size, and therefore multiple copying can be problematic in your application from the memory usage viewpoint.

Therefore we cannot pass a CStringList object by making a copy. In this case, we should pass a reference to the object, using "&" in argument declaration. Now the system does not make a copy of your list, but simply passes a small reference (an address, a pointer).
GeneralRe: Misbehaving StrList.AddTail(pStr[i]); (vc++6) Pin
Tara1413-Jun-06 5:45
Tara1413-Jun-06 5:45 
GeneralRe: Misbehaving StrList.AddTail(pStr[i]); (vc++6) Pin
David Crow13-Jun-06 6:09
David Crow13-Jun-06 6:09 
AnswerRe: Misbehaving StrList.AddTail(pStr[i]); (vc++6) [modified] Pin
_AnsHUMAN_ 13-Jun-06 4:32
_AnsHUMAN_ 13-Jun-06 4:32 
GeneralRe: Misbehaving StrList.AddTail(pStr[i]); (vc++6) Pin
Tara1413-Jun-06 4:55
Tara1413-Jun-06 4:55 
QuestionCopying only first 12 chars of a string to another string? Pin
Lord Kixdemp13-Jun-06 4:04
Lord Kixdemp13-Jun-06 4:04 
AnswerRe: Copying only first 12 chars of a string to another string? Pin
Justin Tay13-Jun-06 4:07
Justin Tay13-Jun-06 4:07 
GeneralRe: Copying only first 12 chars of a string to another string? [modified] Pin
Lord Kixdemp13-Jun-06 4:26
Lord Kixdemp13-Jun-06 4:26 
GeneralRe: Copying only first 12 chars of a string to another string? [modified] Pin
Sebastian Schneider13-Jun-06 4:44
Sebastian Schneider13-Jun-06 4:44 
GeneralRe: Copying only first 12 chars of a string to another string? Pin
Justin Tay13-Jun-06 5:40
Justin Tay13-Jun-06 5:40 
AnswerRe: Copying only first 12 chars of a string to another string? Pin
Zac Howland13-Jun-06 4:43
Zac Howland13-Jun-06 4:43 
GeneralRe: Copying only first 12 chars of a string to another string? Pin
David Crow13-Jun-06 6:27
David Crow13-Jun-06 6:27 
GeneralRe: Copying only first 12 chars of a string to another string? Pin
Zac Howland13-Jun-06 9:04
Zac Howland13-Jun-06 9:04 
AnswerRe: Copying only first 12 chars of a string to another string? Pin
Eytukan13-Jun-06 4:45
Eytukan13-Jun-06 4:45 
GeneralRe: Copying only first 12 chars of a string to another string? [modified] Pin
Lord Kixdemp13-Jun-06 7:17
Lord Kixdemp13-Jun-06 7:17 
GeneralRe: Copying only first 12 chars of a string to another string? Pin
Justin Tay13-Jun-06 8:17
Justin Tay13-Jun-06 8:17 
GeneralRe: Copying only first 12 chars of a string to another string? Pin
Eytukan13-Jun-06 21:12
Eytukan13-Jun-06 21:12 
GeneralRe: Copying only first 12 chars of a string to another string? Pin
Lord Kixdemp14-Jun-06 15:24
Lord Kixdemp14-Jun-06 15:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.