Click here to Skip to main content
15,886,110 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Initialize variable in static library Pin
Maximilien29-Apr-09 0:43
Maximilien29-Apr-09 0:43 
GeneralRe: Initialize variable in static library Pin
Stuart Dootson29-Apr-09 0:46
professionalStuart Dootson29-Apr-09 0:46 
GeneralRe: Initialize variable in static library Pin
samira forooghi29-Apr-09 1:01
samira forooghi29-Apr-09 1:01 
GeneralRe: Initialize variable in static library Pin
Rajesh R Subramanian29-Apr-09 1:21
professionalRajesh R Subramanian29-Apr-09 1:21 
GeneralRe: Initialize variable in static library Pin
samira forooghi29-Apr-09 0:45
samira forooghi29-Apr-09 0:45 
AnswerRe: Initialize variable in static library Pin
Stuart Dootson29-Apr-09 0:45
professionalStuart Dootson29-Apr-09 0:45 
QuestionC++ / JNI object instance problems Pin
megaadam28-Apr-09 23:53
professionalmegaadam28-Apr-09 23:53 
Questioncreating menus dynamically Pin
Farhat Aisha28-Apr-09 23:33
Farhat Aisha28-Apr-09 23:33 
I have a MDI application which has several document types. And I am adding sub-menus dynamically for some of the document types. The follwoing is the code snippet

class CMyMenu: public CMenu
{
int data1;
...
public:
virtual ~CMyMenu(){};
};

Then in the mainframe I declare a function AddNewMenu
CMainFrame::AddMenu(HMENU hMenu)
{

CMyMenu *pMenu = (CSMenu*)CSMenu::FromHandle( toolbarMenu );

CMyMenu* popup1 =

new CSMenu(), *popup2 = new CSMenu();

//create the two pop-up menus
createPopup1(&popup1);
createPopup2(&popup2);


pMenu ->AppendMenu( MF_POPUP, (UINT)popup1->GetSafeHmenu(), "Popup1" );
pMenu ->AppendMenu( MF_POPUP, (UINT)popup2->GetSafeHmenu(), "Popup2" );

...
}

My question is if I call ::DestroyMenu(hMenu) later on, it will delete all the submenus but will it delete the associated "CMyMenu" objects too or do I have to save both popup1 and popup2 to delete the objects my self

Please reply
Thanks
AnswerRe: creating menus dynamically Pin
led mike29-Apr-09 4:21
led mike29-Apr-09 4:21 
QuestionClear X-Box from the system menu Pin
Shashi.Shinde28-Apr-09 23:24
Shashi.Shinde28-Apr-09 23:24 
AnswerRe: Clear X-Box from the system menu Pin
Stuart Dootson29-Apr-09 0:22
professionalStuart Dootson29-Apr-09 0:22 
AnswerRe: Clear X-Box from the system menu Pin
David Crow29-Apr-09 4:34
David Crow29-Apr-09 4:34 
Question[Message Deleted] Pin
Purish Dwivedi28-Apr-09 23:03
Purish Dwivedi28-Apr-09 23:03 
AnswerRe: Multilingual Application (old characters are not getting removed) Pin
Rajesh R Subramanian28-Apr-09 23:11
professionalRajesh R Subramanian28-Apr-09 23:11 
Answer[Message Deleted] Pin
Purish Dwivedi28-Apr-09 23:26
Purish Dwivedi28-Apr-09 23:26 
GeneralRe: Multilingual Application (old characters are not getting removed) Pin
Rajesh R Subramanian28-Apr-09 23:45
professionalRajesh R Subramanian28-Apr-09 23:45 
AnswerRe: Multilingual Application (old characters are not getting removed) Pin
CPallini28-Apr-09 23:31
mveCPallini28-Apr-09 23:31 
Answer[Message Deleted] Pin
Purish Dwivedi28-Apr-09 23:45
Purish Dwivedi28-Apr-09 23:45 
GeneralRe: Multilingual Application (old characters are not getting removed) Pin
CPallini28-Apr-09 23:50
mveCPallini28-Apr-09 23:50 
GeneralRe: Multilingual Application (old characters are not getting removed) Pin
Cedric Moonen28-Apr-09 23:53
Cedric Moonen28-Apr-09 23:53 
GeneralRe: Multilingual Application (old characters are not getting removed) Pin
CPallini29-Apr-09 0:07
mveCPallini29-Apr-09 0:07 
General[Message Deleted] Pin
Purish Dwivedi29-Apr-09 0:13
Purish Dwivedi29-Apr-09 0:13 
QuestionRe: Multilingual Application (old characters are not getting removed) [modified] Pin
CPallini29-Apr-09 0:18
mveCPallini29-Apr-09 0:18 
QuestionAdd text to mouse Cursor Pin
002comp28-Apr-09 21:26
002comp28-Apr-09 21:26 
AnswerRe: Add text to mouse Cursor Pin
Hamid_RT28-Apr-09 21:35
Hamid_RT28-Apr-09 21:35 

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.