Click here to Skip to main content
16,004,974 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: floating point error in C++ Pin
Koolski2-Feb-09 9:56
Koolski2-Feb-09 9:56 
Questionencode wave to ogg [modified] Pin
Daerner Mandla2-Feb-09 5:08
Daerner Mandla2-Feb-09 5:08 
QuestionConverting Microsoft Visual C/C++ version 2.0 solution to Visual C++ 2005/2008 Pin
Cosmin Ciuraru2-Feb-09 3:56
Cosmin Ciuraru2-Feb-09 3:56 
AnswerRe: Converting Microsoft Visual C/C++ version 2.0 solution to Visual C++ 2005/2008 Pin
Iain Clarke, Warrior Programmer2-Feb-09 4:52
Iain Clarke, Warrior Programmer2-Feb-09 4:52 
QuestionError: Debug assertion failed! Pin
sam_psycho2-Feb-09 3:38
sam_psycho2-Feb-09 3:38 
AnswerRe: Error: Debug assertion failed! Pin
Code-o-mat2-Feb-09 3:41
Code-o-mat2-Feb-09 3:41 
GeneralRe: Error: Debug assertion failed! Pin
sam_psycho2-Feb-09 3:47
sam_psycho2-Feb-09 3:47 
GeneralRe: Error: Debug assertion failed! Pin
Code-o-mat2-Feb-09 4:03
Code-o-mat2-Feb-09 4:03 
Well, i think you can do generally 2 things:
1. Load your menu only once and keep it around until your program exits (for example you can load it in the OnInitDialog of your dialog)
2. Load, use and destroy it "on sight", for example, you can use TrackPopupMenuEx[^] with TPM_RETURNCMD, if you do this, when the TrackPopupMenuEx call finishes you will get the command back from the call telling you what the user clicked on (or 0 if he dismissed the menu) and then you can use DestroyMenu[^] to destroy it. Of course doing so you will no longer need your CMenu to hang around so you can make it a local variable and then it will destroy the menu in its destructor when your method exits.

Judging by what i have seen of your code i guess for you the first aproach could be better.

> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <

AnswerRe: Error: Debug assertion failed! Pin
Iain Clarke, Warrior Programmer2-Feb-09 4:26
Iain Clarke, Warrior Programmer2-Feb-09 4:26 
AnswerRe: Error: Debug assertion failed! Pin
David Crow2-Feb-09 5:44
David Crow2-Feb-09 5:44 
Questionstatic Picture control not loading a bmp Pin
VC++Maniac2-Feb-09 1:36
VC++Maniac2-Feb-09 1:36 
AnswerRe: static Picture control not loading a bmp Pin
Hamid_RT2-Feb-09 3:19
Hamid_RT2-Feb-09 3:19 
GeneralRe: static Picture control not loading a bmp Pin
VC++Maniac2-Feb-09 3:20
VC++Maniac2-Feb-09 3:20 
AnswerRe: static Picture control not loading a bmp Pin
Code-o-mat2-Feb-09 3:39
Code-o-mat2-Feb-09 3:39 
GeneralRe: static Picture control not loading a bmp Pin
VC++Maniac2-Feb-09 3:44
VC++Maniac2-Feb-09 3:44 
GeneralRe: static Picture control not loading a bmp Pin
VC++Maniac2-Feb-09 4:12
VC++Maniac2-Feb-09 4:12 
Questioncopying line Pin
mac_g2-Feb-09 0:52
mac_g2-Feb-09 0:52 
AnswerRe: copying line Pin
CPallini2-Feb-09 1:08
mveCPallini2-Feb-09 1:08 
GeneralRe: copying line Pin
mac_g2-Feb-09 1:10
mac_g2-Feb-09 1:10 
GeneralRe: copying line Pin
CPallini2-Feb-09 1:32
mveCPallini2-Feb-09 1:32 
GeneralRe: copying line Pin
mac_g2-Feb-09 2:06
mac_g2-Feb-09 2:06 
GeneralRe: copying line Pin
Malli_S2-Feb-09 1:11
Malli_S2-Feb-09 1:11 
GeneralRe: copying line Pin
mac_g2-Feb-09 1:27
mac_g2-Feb-09 1:27 
GeneralRe: copying line Pin
Malli_S2-Feb-09 2:20
Malli_S2-Feb-09 2:20 
AnswerRe: copying line Pin
David Crow2-Feb-09 5:47
David Crow2-Feb-09 5:47 

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.