Click here to Skip to main content
15,896,111 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generaldisplaying images in a dialog box Pin
ashsri15-Nov-04 5:42
ashsri15-Nov-04 5:42 
GeneralRe: displaying images in a dialog box Pin
pubududilena15-Nov-04 6:25
pubududilena15-Nov-04 6:25 
GeneralWhy Visual C++ generates other function name, but I use extern "C" Pin
Gasanov Tagir15-Nov-04 4:41
Gasanov Tagir15-Nov-04 4:41 
GeneralRe: Why Visual C++ generates other function name, but I use extern "C" Pin
David Crow15-Nov-04 4:59
David Crow15-Nov-04 4:59 
GeneralRe: Why Visual C++ generates other function name, but I use extern "C" Pin
Blake Miller15-Nov-04 10:25
Blake Miller15-Nov-04 10:25 
GeneralRe: Why Visual C++ generates other function name, but I use extern "C" Pin
Gasanov Tagir15-Nov-04 22:49
Gasanov Tagir15-Nov-04 22:49 
QuestionDynamic menus and messages? Pin
One Stone15-Nov-04 4:40
One Stone15-Nov-04 4:40 
AnswerRe: Dynamic menus and messages? Pin
Antony M Kancidrowski15-Nov-04 6:43
Antony M Kancidrowski15-Nov-04 6:43 
What I normally do when given such a requirement is to "block off" a set of contiguous command IDs within resource.h that accommodate for the maximum number of elements in the dynamic menu.
#define ID_DYNAMIC_MENU_START      200
#define ID_DYNAMIC_MENU_RESERVE1   200
#define ID_DYNAMIC_MENU_RESERVE2   201
#define ID_DYNAMIC_MENU_RESERVE3   202
#define ID_DYNAMIC_MENU_RESERVE4   203
#define ID_DYNAMIC_MENU_END        203

Notice I have the DYNAMIC_MENU_START and DYNAMIC_MENU_END pointing at the first and last dynamic menu item respectively. I fill in the ones in the middle as we do not want them used by other resources.

We can now set the menu range accordingly.

Add to the .h
afx_msg void OnDynamicMenu(UINT nID);

Add to the message map
ON_COMMAND_RANGE(ID_DYNAMIC_MENU_START, ID_DYNAMIC_MENU_END, OnDynamicMenu)

Add to the .cpp
void CMyClass::OnDynamicMenu(UINT nID)
{
// nID is the ID of the menu clicked
}


Ant.

I'm hard, yet soft.
I'm coloured, yet clear.
I'm fruity and sweet.
I'm jelly, what am I? Muse on it further, I shall return!
- David Walliams (Little Britain)

GeneralWaiting On Mutes's Pin
sweep12315-Nov-04 4:30
sweep12315-Nov-04 4:30 
GeneralRe: Waiting On Mutes's Pin
Antony M Kancidrowski15-Nov-04 6:12
Antony M Kancidrowski15-Nov-04 6:12 
QuestionHow to get full path of exe file? Pin
pubududilena15-Nov-04 2:00
pubududilena15-Nov-04 2:00 
AnswerRe: How to get full path of exe file? Pin
dabs15-Nov-04 2:09
dabs15-Nov-04 2:09 
GeneralRe: How to get full path of exe file? Pin
pubududilena15-Nov-04 6:15
pubududilena15-Nov-04 6:15 
GeneralRe: How to get full path of exe file? Pin
Maximilien15-Nov-04 6:24
Maximilien15-Nov-04 6:24 
GeneralRe: How to get full path of exe file? Pin
dabs15-Nov-04 6:28
dabs15-Nov-04 6:28 
GeneralRe: How to get full path of exe file? Pin
pubududilena15-Nov-04 6:49
pubududilena15-Nov-04 6:49 
GeneralRe: How to get full path of exe file? Pin
Maximilien15-Nov-04 7:31
Maximilien15-Nov-04 7:31 
GeneralScroll bar Pin
shijuck15-Nov-04 2:00
shijuck15-Nov-04 2:00 
GeneralScrool Bar Painting issue Pin
anuragvelekkattu15-Nov-04 1:53
anuragvelekkattu15-Nov-04 1:53 
GeneralON_UPDATE_COMMAND_UI impossible to change the state of items Pin
madretierra15-Nov-04 1:06
madretierra15-Nov-04 1:06 
GeneralRe: ON_UPDATE_COMMAND_UI impossible to change the state of items Pin
Archigal15-Nov-04 3:05
Archigal15-Nov-04 3:05 
GeneralRe: ON_UPDATE_COMMAND_UI impossible to change the state of items Pin
madretierra15-Nov-04 3:17
madretierra15-Nov-04 3:17 
GeneralImage Colour Management Pin
apollo-house15-Nov-04 0:48
apollo-house15-Nov-04 0:48 
GeneralEnumDisplaySettings gives wrong values Pin
Ray Adams14-Nov-04 23:48
Ray Adams14-Nov-04 23:48 
GeneralRe: EnumDisplaySettings gives wrong values Pin
Antony M Kancidrowski15-Nov-04 0:33
Antony M Kancidrowski15-Nov-04 0:33 

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.