Click here to Skip to main content
16,010,114 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How Can I set a CDialog's location when it display? Pin
Michael Dunn23-Oct-01 9:36
sitebuilderMichael Dunn23-Oct-01 9:36 
Generalusing #import Pin
23-Oct-01 4:19
suss23-Oct-01 4:19 
GeneralRe: using #import Pin
Steen Krogsgaard23-Oct-01 4:22
Steen Krogsgaard23-Oct-01 4:22 
GeneralRe: using #import Pin
23-Oct-01 21:40
suss23-Oct-01 21:40 
GeneralMessage Mapping Pin
Chambers23-Oct-01 4:16
Chambers23-Oct-01 4:16 
GeneralRe: Message Mapping Pin
Steen Krogsgaard23-Oct-01 4:20
Steen Krogsgaard23-Oct-01 4:20 
GeneralRe: Message Mapping Pin
Chambers23-Oct-01 4:28
Chambers23-Oct-01 4:28 
GeneralRe: Message Mapping Pin
Steen Krogsgaard23-Oct-01 4:38
Steen Krogsgaard23-Oct-01 4:38 
Well, I haven't actually done this myself so I guess it's on a rather academic level Wink | ;-)

The MRU in MFC works by using a range of identifiers for the MRU items on the file menu. You could look at the MFC source to get some ideas. But from the top of my head I think MFC reserves 16 identifiers (ID_FILE_MRU1 to ID_FILE_MRU16, not sure about the names). This of course means that there's a max of 16 items on the MRU list. It then maps this range to a function (OnFileMru maybe?). Since the ID of the selected item is passed to the message handler you can surely take it from there.

So what you'll need is a first identifier and a maximum possible last identifier (there's nobody preventing you from setting it to first id + 200, that should kindda cover it, right?), and some assurance that your IDs are not used by other menu items. Those identifiers that are not in use at any particular moment will not be selectable and will thus not generate any WM_COMMANDs, so there's no need to sanity-check the ID that caused the WM_COMMAND in the handler (but I would do it anyway, just out of paranoia Wink | ;-)

Cheers
Steen.

"To claim that computer games influence children is rediculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"
QuestionCan anybody help me,please? Pin
Daniel Visan23-Oct-01 3:13
Daniel Visan23-Oct-01 3:13 
AnswerRe: Can anybody help me,please? Pin
Daniel Visan23-Oct-01 3:20
Daniel Visan23-Oct-01 3:20 
GeneralPLEASE, STOP SENDING ME FILES!!!!! Pin
Daniel Visan23-Oct-01 3:53
Daniel Visan23-Oct-01 3:53 
GeneralRe: PLEASE, STOP SENDING ME FILES!!!!! Pin
Christian Graus23-Oct-01 9:39
protectorChristian Graus23-Oct-01 9:39 
GeneralMutiple language Pin
23-Oct-01 2:43
suss23-Oct-01 2:43 
GeneralRe: Mutiple language Pin
Tomasz Sowinski23-Oct-01 2:53
Tomasz Sowinski23-Oct-01 2:53 
GeneralRe: Mutiple language Pin
23-Oct-01 3:15
suss23-Oct-01 3:15 
GeneralRe: Mutiple language Pin
Tomasz Sowinski23-Oct-01 3:21
Tomasz Sowinski23-Oct-01 3:21 
GeneralRe: Mutiple language Pin
ZAZA23-Oct-01 3:51
ZAZA23-Oct-01 3:51 
GeneralRe: Mutiple language Pin
Tomasz Sowinski23-Oct-01 4:02
Tomasz Sowinski23-Oct-01 4:02 
GeneralRe: Mutiple language Pin
Carlos Antollini23-Oct-01 4:02
Carlos Antollini23-Oct-01 4:02 
GeneralRe: Mutiple language Pin
ZAZA23-Oct-01 20:18
ZAZA23-Oct-01 20:18 
GeneralProblems with debugging Pin
Matjaz23-Oct-01 2:33
Matjaz23-Oct-01 2:33 
GeneralRe: Problems with debugging Pin
Andres Manggini23-Oct-01 5:07
Andres Manggini23-Oct-01 5:07 
GeneralRe: Problems with debugging Pin
Christian Graus23-Oct-01 9:46
protectorChristian Graus23-Oct-01 9:46 
GeneralRe: Problems with debugging Pin
Andrew Peace23-Oct-01 10:34
Andrew Peace23-Oct-01 10:34 
GeneralCRecordSet.Requery(); Pin
23-Oct-01 2:32
suss23-Oct-01 2:32 

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.