Home > Software engineering >  The document structure, interface problem.
The document structure, interface problem.

Time:02-11

How to set the MENU to gray, now can't use,
In mainfrm use, there is no effect
 
PSubMenu=pMenu - & gt; GetSubMenu (1);
PSubMenu - & gt; EnableMenuItem (ID_CFG,
MF_BYCOMMAND
| MF_DISABLED
| MF_GRAYED);

 
if (! ProcessShellCommand (cmdInfo))
Return FALSE;

When the initial create multiple Windows, use the registration document template, how to obtain each window VIEW of pointer,

Use this code in mainfrm, couldn't get
 CWinApp * pApp=AfxGetApp (); 
The POSITION PosDocTemplate=pApp - & gt; GetFirstDocTemplatePosition ();
While (PosDocTemplate)
{
CDocTemplate * pDocTemplate=pApp - & gt; GetNextDocTemplate (PosDocTemplate);

The POSITION PosDoc=pDocTemplate - & gt; GetFirstDocPosition ();
While (PosDoc)
{
CDocument * pDoc=pDocTemplate - & gt; GetNextDoc (PosDoc);

The POSITION PosView=pDoc - & gt; GetFirstViewPosition ();//here for empty
While (PosView)
{
The CView * pView=pDoc - & gt; GetNextView (PosView);

}
}
}


How to set up the document window to the front of the most,
Press each button to each window to the top


 CMultiDocTemplate * pDocTemplate; 
PDocTemplate=new CMultiDocTemplate (IDR_MAINFRAME,
RUNTIME_CLASS (CHDRGuiDoc),
RUNTIME_CLASS (CChildFrame),//a custom frame of MDI child
RUNTIME_CLASS (CHDRGuiView1));
if (! PDocTemplate)
Return FALSE;
AddDocTemplate (pDocTemplate);

//create a main MDI frame window
CMainFrame * pMainFrame=new CMainFrame;
if (! PMainFrame | |! PMainFrame - & gt; LoadFrame (IDR_MAINFRAME))
{
The delete pMainFrame;
Return FALSE;
}
M_pMainWnd=pMainFrame;
//only when it has the suffix call DragAcceptFiles
//in an MDI application, this should happen immediately after setting m_pMainWnd

//m_hInitMenu=: : LoadMenu (HLNST, MAKEINTRESOURCE (IDR_MAINFRAME));
//m_hOPMenu=: : LoadMenu (HLNST, MAKEINTRESOURCE (IDR_HDRGuiTYPE));
/* -- -- -- -- -- -- -- -- -- -- -- -- -- -- Add by tong -- -- -- -- -- -- -- -- -- -- */
//the main window and each child window (file window) are willing to accept from the Shell drag and drop files
M_pMainWnd - & gt; DragAcceptFiles (TRUE);

//when the Shell on the program files fast by two times, the program can open the file and read
EnableShellOpen ();

//registered the program file type with the Shell,
RegisterShellFileTypes (TRUE);
/* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - */


//the analysis standard shell command, DDE, open the file operations command line
CCommandLineInfo cmdInfo;
ParseCommandLine (cmdInfo);


//scheduling command specified on the command line, if
//use/RegServer/Register,/Unregserver or Unregister start the application, it returns FALSE,
if (! ProcessShellCommand (cmdInfo))
Return FALSE;
if (! ProcessShellCommand (cmdInfo))
Return FALSE;
if (! ProcessShellCommand (cmdInfo))
Return FALSE;
if (! ProcessShellCommand (cmdInfo))
Return FALSE;
//the main window has been initialized, so show and update it
//the main window to start to maximize
PMainFrame - & gt; ShowWindow (SW_SHOWMAXIMIZED/* */m_nCmdShow);
PMainFrame - & gt; UpdateWindow ();

Return TRUE;

CodePudding user response:

for help

CodePudding user response:

Under the top ,,,,,,,,

CodePudding user response:

ON_UPDATE_COMMAND_UI ()
PCmdUI - & gt; The Enable (FALSE);

CodePudding user response:

How to set OnUpdateCommandUI

CodePudding user response:

reference 4 floor hurryboylqs response:
OnUpdateCommandUI set in the

Thank you, menu problem solved

CodePudding user response:

The
reference 3 floor VisualEleven response:
ON_UPDATE_COMMAND_UI ()
PCmdUI - & gt; The Enable (FALSE);

Point the button of the each window to the front, what to use?

Window is that the initial time to create,
 if (! ProcessShellCommand (cmdInfo)) 
Return FALSE;

CodePudding user response:

refer to 6th floor sinat_26659461 response:
Quote: refer to the third floor VisualEleven response:

ON_UPDATE_COMMAND_UI ()
PCmdUI - & gt; The Enable (FALSE);

Point the button of the each window to the front, what to use?

Window is that the initial time to create,
 if (! ProcessShellCommand (cmdInfo)) 
Return FALSE;

CMDIChildWnd: : MDIActivate ()??

CodePudding user response:

refer to 7th floor 7-eleven's response:
Quote: refer to the sixth floor sinat_26659461 response:

Quote: refer to the third floor VisualEleven response:

ON_UPDATE_COMMAND_UI ()
PCmdUI - & gt; The Enable (FALSE);

Point the button of the each window to the front, what to use?

Window is that the initial time to create,
 if (! ProcessShellCommand (cmdInfo)) 
Return FALSE;

CMDIChildWnd: : MDIActivate ()??

Is this, the problem is solved
  • Related