Click here to Skip to main content
15,914,417 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generalpuzzled about this: STL vector Pin
ns12-Feb-03 9:26
ns12-Feb-03 9:26 
GeneralRe: puzzled about this: STL vector Pin
Christian Graus12-Feb-03 9:29
protectorChristian Graus12-Feb-03 9:29 
GeneralRe: puzzled about this: STL vector Pin
Tim Smith12-Feb-03 9:30
Tim Smith12-Feb-03 9:30 
GeneralRe: puzzled about this: STL vector Pin
palbano12-Feb-03 9:30
palbano12-Feb-03 9:30 
GeneralRe: puzzled about this: STL vector Pin
nss12-Feb-03 11:00
nss12-Feb-03 11:00 
GeneralProblem with sub menus Pin
Anonymous12-Feb-03 9:09
Anonymous12-Feb-03 9:09 
GeneralRe: Problem with sub menus Pin
KaЯl13-Feb-03 2:34
KaЯl13-Feb-03 2:34 
GeneralRe: Problem with sub menus Pin
Anonymous13-Feb-03 3:10
Anonymous13-Feb-03 3:10 
Ok, here is the line I am using in my CWinApp derived app, in the InitInstance, (AFTER the CSingleDocTemplate has loaded specifying the menu (IDR_MAINFRAME) AND after Show() has been called)
[ccode]
CSingleDocTemplate* pDocTemplate;
pDocTemplate = new CSingleDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CWinAppDoc),
RUNTIME_CLASS(CMainFrame),
RUNTIME_CLASS(CWinAppView));
AddDocTemplate(pDocTemplate);
... code to determine that some menu items are to be disabled ...

m_pMainWnd->GetMenu()->GetSubMenu(0)->EnableMenuItem(i, MF_BYPOSITION|MF_GRAYED);
[/ccode]
That line 'works', but when I try to exand SubMenu 0 ('File') it blows up here:
[ccode]
_AFXWIN_INLINE UINT CMenu::GetMenuItemCount() const
{ ASSERT(::IsMenu(m_hMenu)); return ::GetMenuItemCount(m_hMenu); }
[/ccode]

Which is being called from: CFrameWnd::OnInitMenuPopup(CMenu * 0x00bf6b80 {CTempMenu}, unsigned int 0, int 0)

I think it's because the menu hasn't been init'ed but the calls to modify the menu don't fail. WTF | :WTF:
GeneralRe: Problem with sub menus Pin
KaЯl13-Feb-03 3:31
KaЯl13-Feb-03 3:31 
GeneralRe: Problem with sub menus Pin
Scorp1us13-Feb-03 9:18
Scorp1us13-Feb-03 9:18 
GeneralRe: Problem with sub menus Pin
KaЯl13-Feb-03 10:15
KaЯl13-Feb-03 10:15 
GeneralRe: Problem with sub menus Pin
tim63520-Mar-05 21:56
tim63520-Mar-05 21:56 
GeneralRe: Problem with sub menus Pin
KaЯl20-Mar-05 23:11
KaЯl20-Mar-05 23:11 
GeneralRe: Problem with sub menus Pin
tim63521-Mar-05 2:59
tim63521-Mar-05 2:59 
GeneralShareable objects... Pin
BlackSmith12-Feb-03 9:05
BlackSmith12-Feb-03 9:05 
GeneralRe: Shareable objects... Pin
palbano12-Feb-03 9:26
palbano12-Feb-03 9:26 
GeneralRe: Shareable objects... Pin
BlackSmith12-Feb-03 9:48
BlackSmith12-Feb-03 9:48 
GeneralRe: Shareable objects... Pin
palbano12-Feb-03 11:58
palbano12-Feb-03 11:58 
GeneralRe: Shareable objects... Pin
Chris Richardson12-Feb-03 11:58
Chris Richardson12-Feb-03 11:58 
QuestionCan I add a menu to a dialog based application? Pin
work_to_live12-Feb-03 8:48
work_to_live12-Feb-03 8:48 
AnswerRe: Can I add a menu to a dialog based application? Pin
Chris Losinger12-Feb-03 8:52
professionalChris Losinger12-Feb-03 8:52 
GeneralRe: Can I add a menu to a dialog based application? Pin
work_to_live12-Feb-03 9:05
work_to_live12-Feb-03 9:05 
GeneralCImage & Transparency Pin
loading12-Feb-03 8:01
loading12-Feb-03 8:01 
QuestionReliable way to convert float to a double? Pin
Member 9612-Feb-03 7:40
Member 9612-Feb-03 7:40 
AnswerRe: Reliable way to convert float to a double? Pin
Chris Losinger12-Feb-03 7:51
professionalChris Losinger12-Feb-03 7:51 

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.