Click here to Skip to main content
15,925,723 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralQuestion about FindWindow. Pin
George210-Oct-03 17:36
George210-Oct-03 17:36 
GeneralRe: Question about FindWindow. Pin
Anthony_Yio10-Oct-03 22:25
Anthony_Yio10-Oct-03 22:25 
GeneralRe: Question about FindWindow. Pin
George211-Oct-03 19:43
George211-Oct-03 19:43 
General.NET and assembly Pin
Sirrius10-Oct-03 17:31
Sirrius10-Oct-03 17:31 
GeneralRe: .NET and assembly Pin
ZoogieZork10-Oct-03 18:20
ZoogieZork10-Oct-03 18:20 
GeneralRe: .NET and assembly Pin
Blake Coverett10-Oct-03 21:02
Blake Coverett10-Oct-03 21:02 
GeneralRe: .NET and assembly Pin
Beer2611-Oct-03 7:08
Beer2611-Oct-03 7:08 
GeneralRe: .NET and assembly Pin
Blake Coverett11-Oct-03 10:06
Blake Coverett11-Oct-03 10:06 
Generalhash trouble Pin
Sirrius10-Oct-03 17:27
Sirrius10-Oct-03 17:27 
GeneralRe: hash trouble Pin
ZoogieZork10-Oct-03 18:11
ZoogieZork10-Oct-03 18:11 
Questionhow to resize and reposition all the controls in a dialog Pin
pampatipraveen10-Oct-03 16:29
pampatipraveen10-Oct-03 16:29 
AnswerRe: how to resize and reposition all the controls in a dialog Pin
Ravi Bhavnani10-Oct-03 16:46
professionalRavi Bhavnani10-Oct-03 16:46 
Generalpassing parameters Pin
Sirrius10-Oct-03 14:00
Sirrius10-Oct-03 14:00 
GeneralRe: passing parameters Pin
Michael Dunn10-Oct-03 14:47
sitebuilderMichael Dunn10-Oct-03 14:47 
GeneralRe: passing parameters Pin
Sirrius10-Oct-03 15:04
Sirrius10-Oct-03 15:04 
GeneralRe: passing parameters Pin
Phil Hamer10-Oct-03 15:34
Phil Hamer10-Oct-03 15:34 
GeneralRe: passing parameters Pin
Sirrius10-Oct-03 15:52
Sirrius10-Oct-03 15:52 
GeneralMFC Application with DTML GUI Pin
blueinred10-Oct-03 13:11
blueinred10-Oct-03 13:11 
GeneralRe: MFC Application with DTML GUI Pin
Scozturk10-Oct-03 22:16
professionalScozturk10-Oct-03 22:16 
GeneralTab Ctrl!! Pin
kannada10-Oct-03 13:02
kannada10-Oct-03 13:02 
QuestionHow to create sounds Pin
Deepak Samuel10-Oct-03 13:02
Deepak Samuel10-Oct-03 13:02 
AnswerRe: How to create sounds Pin
John M. Drescher10-Oct-03 13:38
John M. Drescher10-Oct-03 13:38 
GeneralRe: How to create sounds Pin
Scozturk10-Oct-03 22:12
professionalScozturk10-Oct-03 22:12 
Generallinked list problem Pin
K. Shaffer10-Oct-03 12:09
K. Shaffer10-Oct-03 12:09 
GeneralRe: linked list problem Pin
Phil Hamer10-Oct-03 12:24
Phil Hamer10-Oct-03 12:24 
The CApproach object returned from ParseApproach is a temporary object. You're passing the address of this temporary to Insert. When the temporary object is destroyed automatically the pointer to it points to garbage. You can either let Insert take a copy of a CApproach object instead of a pointer:

<br />
int PrintList::Insert(CApproach approach)<br />


or you can assign the result of ParseApproach to a local variable, but keep in mind that when that variable goes out of scope, the pointer to it will point to garbage:

<br />
CApproach result = ParseApproach(codestring);<br />
list->Insert(&result);<br />
list->print();<br />


You could also pass Insert a pointer to an object allocated on the heap, but you have to remember to delete it when you're done with it.

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.