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

C / C++ / MFC

 
GeneralRe: Handle Pin
wabc3-Jul-02 14:54
wabc3-Jul-02 14:54 
GeneralCTRL+Z and Edit Controls Pin
Braulio Dez3-Jul-02 4:47
Braulio Dez3-Jul-02 4:47 
GeneralAddin load problem Pin
Zizilamoroso3-Jul-02 4:36
Zizilamoroso3-Jul-02 4:36 
GeneralChanging Static Text Font Pin
Dan Broomall3-Jul-02 3:54
Dan Broomall3-Jul-02 3:54 
GeneralRe: Changing Static Text Font Pin
Michael P Butler3-Jul-02 4:12
Michael P Butler3-Jul-02 4:12 
GeneralRe: Changing Static Text Font Pin
benjymous3-Jul-02 5:45
benjymous3-Jul-02 5:45 
Generaltrying to disable a menu item in an MDI Pin
ns3-Jul-02 3:45
ns3-Jul-02 3:45 
GeneralRe: trying to disable a menu item in an MDI Pin
Mike Upton5-Jul-02 2:56
Mike Upton5-Jul-02 2:56 
I suspect you're running into a null pointer problem. If this code is in the CFormView object, GetMenu() will return NULL because the menu doesn't actually belong to the view, or even to the view's parent frame. The application's menu belongs to the main frame, so you need to do this instead:
CMenu* mmenu = AfxGetMainWnd()->GetMenu();

But if I were you, I wouldn't do it that way anyway. I'd add a member variable to your document class, which you would set when you did the login. Then, add an update handler to your document class for ID_FILE_NEW (the easiest way to do that is via ClassWizard), and enable or disable the menu item based on that member variable:
CMyDocument::OnUpdateFileNew(CCmdUI* pCmdUI)
{
  pCmdUI->Enable(m_bLoginOk);
}


That way, if you had a toolbar button for file new, that would also be enabled or disabled correctly.



"We are the knights who say Ni" (The Knights Who Say Ni)
GeneralRe: trying to disable a menu item in an MDI Pin
ns5-Jul-02 3:08
ns5-Jul-02 3:08 
Generalcombining MFC and callback function Pin
3-Jul-02 3:40
suss3-Jul-02 3:40 
GeneralRe: combining MFC and callback function Pin
_Magnus_3-Jul-02 3:46
_Magnus_3-Jul-02 3:46 
GeneralRe: combining MFC and callback function Pin
3-Jul-02 21:52
suss3-Jul-02 21:52 
Generalfile /open dialog filter in MDI Pin
ns3-Jul-02 3:24
ns3-Jul-02 3:24 
GeneralDeclaring function that throw exceptions Pin
Alexandru Savescu3-Jul-02 3:07
Alexandru Savescu3-Jul-02 3:07 
GeneralRe: Declaring function that throw exceptions Pin
Orbital^3-Jul-02 3:27
Orbital^3-Jul-02 3:27 
GeneralRe: Declaring function that throw exceptions Pin
Alexandru Savescu3-Jul-02 3:32
Alexandru Savescu3-Jul-02 3:32 
GeneralRe: Declaring function that throw exceptions Pin
Orbital^3-Jul-02 3:43
Orbital^3-Jul-02 3:43 
GeneralRe: Declaring function that throw exceptions Pin
Len Holgate3-Jul-02 22:14
Len Holgate3-Jul-02 22:14 
GeneralCharacter Sets Pin
Matthew R. Miller3-Jul-02 2:23
Matthew R. Miller3-Jul-02 2:23 
GeneralProbelm in reading images Pin
SamirSood3-Jul-02 1:39
SamirSood3-Jul-02 1:39 
GeneralGDI+ and MFC Pin
Williams3-Jul-02 1:38
Williams3-Jul-02 1:38 
GeneralRe: GDI+ and MFC Pin
Christian Graus3-Jul-02 1:53
protectorChristian Graus3-Jul-02 1:53 
QuestionWhere can I find a DB2 CLI function C++ class wrapper? Pin
wabc3-Jul-02 0:51
wabc3-Jul-02 0:51 
AnswerRe: Where can I find a DB2 CLI function C++ class wrapper? Pin
DiWa4-Jul-02 0:13
DiWa4-Jul-02 0:13 
GeneralList Control with Printing Support Pin
Renjith Ramachandran3-Jul-02 0:16
Renjith Ramachandran3-Jul-02 0:16 

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.