How to handle dynamic menus in mfc? What happens when client calls cocreateinstance?



How to handle dynamic menus in mfc? What happens when client calls cocreateinstance?..

Answer / Mohd Nadeem

In MFC, you can create dynamic menus by creating a menu resource and modifying it at runtime. To handle such menus, override the OnCreateMenu() or OnCreateContextMenu() function. When a client calls CoCreateInstance(), it creates a new COM object using the specified class ID and allocates memory for it.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More MFC Interview Questions

how u can move CDC pointer to one line in cview?

2 Answers  


What is a critical section and how is it implemented?

2 Answers  


what is the use of CCmdTarget?

4 Answers   Siemens,


1)does Frame Thickness in MFC?

1 Answers   winfoware,


What does mfc stand for?

1 Answers  


Hi All, I have created one MFC Dialog Based application.now if i am running the application its working fine,instead of closing he application i minimized the application,if i run the application again,i am getting the Dialog. I want to prevent the calling of application multiple times. please give me the code and let me know in which method i need to make changes. Praveer

7 Answers   HP,


1)How to change a text of a button as Dynamically?

1 Answers   HCL,


What is userdefine Messages in MFC?

1 Answers   HCL,


what is the use of CWinApp class?

3 Answers   Mphasis,


What is Thread ?(VC++)What is the difference between Cmutex and Csemaphone?

5 Answers   Atos Origin,


How to setup a timer?

3 Answers   IBM,


Psychic Window Technique

2 Answers   E Logic, Wild Net,


Categories