Click here to Skip to main content
15,920,217 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Shorcutkey problem [modified] Pin
Parthi_Appu22-Mar-07 20:52
Parthi_Appu22-Mar-07 20:52 
GeneralRe: Shorcutkey problem Pin
rushiraj.jhala22-Mar-07 21:31
rushiraj.jhala22-Mar-07 21:31 
GeneralRe: Shorcutkey problem Pin
Parthi_Appu23-Mar-07 0:11
Parthi_Appu23-Mar-07 0:11 
GeneralRe: Shorcutkey problem Pin
SelvaKr23-Mar-07 0:49
SelvaKr23-Mar-07 0:49 
GeneralRe: Shorcutkey problem Pin
rushiraj.jhala23-Mar-07 2:17
rushiraj.jhala23-Mar-07 2:17 
QuestionCan we remove or Hide Menu bar from Form View?? Pin
megha_gharote22-Mar-07 19:46
megha_gharote22-Mar-07 19:46 
AnswerRe: Can we remove or Hide Menu bar from Form View?? Pin
Karismatic22-Mar-07 23:37
Karismatic22-Mar-07 23:37 
GeneralRe: Can we remove or Hide Menu bar from Form View?? Pin
megha_gharote23-Mar-07 0:21
megha_gharote23-Mar-07 0:21 
hey Pankaj,
see i got something using which u can remove menu from SDI..
i m pasting that code here. Actually it is mentioned for both SDI and MDI..
i m not able to put it for MDI.. see if u can do it.. let me know the same..

/****cotents from a document*********/

Steps to Create MDI Application that Has No Menu Bar
1. Generate an MDI application with AppWizard. Do not delete the IDR_MAINFRAME menu resource. If you have an application that was not generated with AppWizard, do not delete the corresponding main menu resource. Leaving the menu resource is required to avoid assertion failures in the MFC code.
2. Delete menu resources associated with MDI child windows (IDR_xxxTYPE). They are not used. By deleting them, you avoid a resource (memory) leak.
3. Override the PreCreateWindow() function for the CMainFrame class:
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
if(cs.hMenu!=NULL)
{
::DestroyMenu(cs.hMenu); // delete menu if loaded
cs.hMenu = NULL; // no menu for this window
}

return CMDIFrameWnd::PreCreateWindow(cs);
}

4. Modify the code responsible for switching menus by overriding the LoadFrame() and OnCreateClient() methods of CMainFrame. This is necessary because MFC has already loaded and switched menus automatically. The following shows what must be done:
// Overridden method declarations for CMainFrame

BOOL LoadFrame( UINT nIDResource,
DWORD dwDefaultStyle = WS_OVERLAPPEDWINDOW | FWS_ADDTOTITLE,
CWnd* pParentWnd = NULL, CCreateContext* pContext = NULL );
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs,
CCreateContext* /*pContext*/);

// Overridden method declarations for CMainFrame

BOOL CMainFrame::LoadFrame(UINT nIDResource, DWORD dwDefaultStyle,
CWnd* pParentWnd, CCreateContext* pContext)
{
return CFrameWnd::LoadFrame(nIDResource,dwDefaultStyle,
pParentWnd,pContext);
}

BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs,
CCreateContext* /*pContext*/)
{
return CreateClient(lpcs,NULL);
}


NOTE: Instead of calling the base class (CMDIFrameWnd) in the override of LoadFrame, you call its base class, CFrameWnd, instead. That way you can avoid the code that deals with MDI menus.


Megha
We must adjust to changing times and still hold to unchanging principles
QuestionResource error Pin
rushiraj.jhala22-Mar-07 19:12
rushiraj.jhala22-Mar-07 19:12 
AnswerRe: Resource error Pin
_AnsHUMAN_ 22-Mar-07 19:27
_AnsHUMAN_ 22-Mar-07 19:27 
GeneralRe: Resource error Pin
rushiraj.jhala22-Mar-07 19:47
rushiraj.jhala22-Mar-07 19:47 
AnswerRe: Resource error Pin
Phil J Pearson23-Mar-07 7:53
Phil J Pearson23-Mar-07 7:53 
GeneralRe: Resource error Pin
rushiraj.jhala23-Mar-07 19:24
rushiraj.jhala23-Mar-07 19:24 
Questionshellexecuteex Pin
deeps_cute22-Mar-07 19:07
deeps_cute22-Mar-07 19:07 
AnswerRe: shellexecuteex Pin
prasad_som22-Mar-07 19:27
prasad_som22-Mar-07 19:27 
AnswerRe: shellexecuteex Pin
Naveen22-Mar-07 20:03
Naveen22-Mar-07 20:03 
AnswerRe: shellexecuteex Pin
Stephen Hewitt23-Mar-07 12:29
Stephen Hewitt23-Mar-07 12:29 
QuestionLine Of Code counter - doesn't work Pin
XTAL25622-Mar-07 18:48
XTAL25622-Mar-07 18:48 
AnswerRe: Line Of Code counter - doesn't work Pin
toxcct22-Mar-07 20:50
toxcct22-Mar-07 20:50 
GeneralRe: Line Of Code counter - doesn't work Pin
XTAL25622-Mar-07 21:19
XTAL25622-Mar-07 21:19 
AnswerRe: Line Of Code counter - doesn't work [modified] Pin
John R. Shaw22-Mar-07 21:18
John R. Shaw22-Mar-07 21:18 
AnswerRe: Line Of Code counter - doesn't work Pin
kakan22-Mar-07 22:08
professionalkakan22-Mar-07 22:08 
GeneralRe: Line Of Code counter - doesn't work Pin
XTAL25623-Mar-07 14:15
XTAL25623-Mar-07 14:15 
QuestionHow to get the original size of a pe file Pin
white jungle22-Mar-07 18:38
white jungle22-Mar-07 18:38 
AnswerRe: How to get the original size of a pe file Pin
Karismatic22-Mar-07 23:10
Karismatic22-Mar-07 23:10 

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.