Click here to Skip to main content
15,918,485 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Can I create a dialog template for other dialog boxes? Pin
fat_boy20-Jun-12 6:31
fat_boy20-Jun-12 6:31 
AnswerRe: Can I create a dialog template for other dialog boxes? Pin
Albert Holguin20-Jun-12 7:04
professionalAlbert Holguin20-Jun-12 7:04 
GeneralRe: Can I create a dialog template for other dialog boxes? Pin
DeepT20-Jun-12 7:33
DeepT20-Jun-12 7:33 
GeneralRe: Can I create a dialog template for other dialog boxes? Pin
Albert Holguin20-Jun-12 8:33
professionalAlbert Holguin20-Jun-12 8:33 
AnswerRe: Can I create a dialog template for other dialog boxes? Pin
Rolf Kristensen20-Jun-12 9:00
Rolf Kristensen20-Jun-12 9:00 
AnswerRe: Can I create a dialog template for other dialog boxes? Pin
ThatsAlok20-Jun-12 20:18
ThatsAlok20-Jun-12 20:18 
QuestionA professional and rich-content toolkit for designing great UI Pin
m.salsal20-Jun-12 1:15
m.salsal20-Jun-12 1:15 
AnswerRe: A professional and rich-content toolkit for designing great UI Pin
Richard MacCutchan20-Jun-12 3:13
mveRichard MacCutchan20-Jun-12 3:13 
AnswerRe: A professional and rich-content toolkit for designing great UI Pin
Albert Holguin20-Jun-12 3:28
professionalAlbert Holguin20-Jun-12 3:28 
AnswerRe: A professional and rich-content toolkit for designing great UI Pin
Maximilien20-Jun-12 3:40
Maximilien20-Jun-12 3:40 
GeneralRe: A professional and rich-content toolkit for designing great UI Pin
Albert Holguin20-Jun-12 3:49
professionalAlbert Holguin20-Jun-12 3:49 
AnswerRe: A professional and rich-content toolkit for designing great UI Pin
fat_boy20-Jun-12 3:49
fat_boy20-Jun-12 3:49 
GeneralRe: A professional and rich-content toolkit for designing great UI Pin
Albert Holguin20-Jun-12 4:03
professionalAlbert Holguin20-Jun-12 4:03 
GeneralRe: A professional and rich-content toolkit for designing great UI Pin
fat_boy20-Jun-12 6:30
fat_boy20-Jun-12 6:30 
AnswerRe: A professional and rich-content toolkit for designing great UI Pin
Vaclav_20-Jun-12 4:22
Vaclav_20-Jun-12 4:22 
AnswerRe: A professional and rich-content toolkit for designing great UI Pin
bob1697220-Jun-12 10:34
bob1697220-Jun-12 10:34 
QuestionMfc100d.dll Not Found Pin
AmbiguousName19-Jun-12 18:13
AmbiguousName19-Jun-12 18:13 
AnswerRe: Mfc100d.dll Not Found Pin
Richard MacCutchan19-Jun-12 20:59
mveRichard MacCutchan19-Jun-12 20:59 
AnswerRe: Mfc100d.dll Not Found Pin
Sivaraman Dhamodharan19-Jun-12 22:39
Sivaraman Dhamodharan19-Jun-12 22:39 
GeneralRe: Mfc100d.dll Not Found Pin
ThatsAlok20-Jun-12 20:20
ThatsAlok20-Jun-12 20:20 
GeneralRe: Mfc100d.dll Not Found Pin
Sivaraman Dhamodharan21-Jun-12 1:23
Sivaraman Dhamodharan21-Jun-12 1:23 
AnswerRe: Mfc100d.dll Not Found Pin
Albert Holguin20-Jun-12 3:23
professionalAlbert Holguin20-Jun-12 3:23 
AnswerRe: Mfc100d.dll Not Found Pin
Brandon-X1200021-Jun-12 21:41
Brandon-X1200021-Jun-12 21:41 
QuestionC structs dynamic vs local stack Pin
Bacchus Beale19-Jun-12 16:16
Bacchus Beale19-Jun-12 16:16 
AnswerRe: C structs dynamic vs local stack Pin
Chris Losinger19-Jun-12 16:47
professionalChris Losinger19-Jun-12 16:47 
unless you know your tree will never exceed a certain number of nodes, you will most certainly have to use some kind of dynamic memory allocation (ex. malloc).

but...

in getResponse:
struct thing2 tmp2 = getThing2();
struct thing1 tmp1 = getThing1();
struct thing1 *p1 = &tmp1;
struct thing2 *p2 = &tmp2;


tmp1 and tmp2 are going to go out of scope when the function exits, so p1 and p2 are going to be pointing at garbage.

the malloc version works because those dynamically allocated structs still exist after the function exits.

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.