| |

VerySource

 Forgot password?
 Register
Search
Author: yncyncync

Very poor question, MDI form!

[Copy link]

1

Threads

9

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

 Author| Post time: 2020-12-15 07:00:01
| Show all posts
How to call it?
I know this will show my dialog
// Create organizational unit dialog
  CDWBM dlg;
  dlg.DoModal();

How to call my subform?
Reply

Use magic Report

1

Threads

9

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

 Author| Post time: 2020-12-15 11:45:01
| Show all posts
I want to call a form that can be maximized and minimized, not a dialog box
Reply

Use magic Report

0

Threads

5

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-12-15 14:30:01
| Show all posts
pretendersam
You can place controls on CFormView, just like you do in Delphi.
Try to create a new MFC MDI project based on CFormView, just use it.

-------------------------------------------------- -----
Using MDI as the main and sub-window in vc is the same as delphi.
The CFORMVIEW he said is the class of the display window, which is actually the same as the one in your delphi
The control adding interface is the same, except that there are three windows in vc.
What kind of reflection is required when double-clicking, what kind of reflection is initialized.

To maximize and minimize is to set its properties when creating the form.
Choose to maximize or minimize.

Each window has a base such as a window class, and then defines a pointer to control
This window will do.


A classview, resourceview, documentview.
In resourceview, it is the same as adding a window to your control.

If you want to call, you need to click on mfc, and you can write what kind of reflection you want to reflect.
Reply

Use magic Report

0

Threads

5

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-12-18 19:15:01
| Show all posts
LZ does not have any VC programming concepts, or does not understand MFC at all, so use the tools you are familiar with, otherwise it will only get twice the result with half the effort.
Reply

Use magic Report

1

Threads

9

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

 Author| Post time: 2020-12-20 08:00:01
| Show all posts
Except forlgq1982, the rest are a bunch of rice buckets, super rice buckets.

Tell beginners: how to design MDI programs with VC.

1. First create a multi-document program;
2. Click [Insert], [New Form...] menu item.
   Enter CTemp1View in Name
   Base Class select CFormView
   Do not move the others, click the "OK" button.
3. Click [Insert], [New Class...] menu item.
         Name: CTempFrm
   Base class: CMDIChildWnd
   Click the "OK" button.
4. Add in CXXXApp
   public:
     CMultiDocTemplate * m_pTemplate;
5. In CXXXApp, modify the code of InitInstance().

   SetRegistryKey(_T("Local AppWizard-Generated Applications"));

LoadStdProfileSettings(); // Load standard INI file options (including MRU)

// Register the application's document templates. Document templates
// serve as the connection between documents, frame windows and views.

//CMultiDocTemplate* pDocTemplate; //comment out
//pDocTemplate = new CMultiDocTemplate( //comment out
         //Add your own MDI child form
m_pTemplate = new CMultiDocTemplate(
IDR_XXXTYPE, // unchanged here
RUNTIME_CLASS(CXXXDoc), // unchanged here
RUNTIME_CLASS(CTempFrm), // need to be modified
RUNTIME_CLASS(CTempView));//Need to modify
AddDocTemplate(m_pTemplate);
         //If there are other forms
         m_pTemplate2 = new CMultiDocTemplate(
IDR_XXXTYPE, // unchanged here
RUNTIME_CLASS(CXXXDoc), // unchanged here
RUNTIME_CLASS(CTemp2Frm), // need to be modified
RUNTIME_CLASS(CTemp2View));//Need to modify
AddDocTemplate(m_pTemplate2);
         m_pTemplate3 = new CMultiDocTemplate(
IDR_XXXTYPE, // unchanged here
RUNTIME_CLASS(CXXXDoc), // unchanged here
RUNTIME_CLASS(CTemp3Frm), // need to be modified
RUNTIME_CLASS(CTemp3View));//Need to modify
AddDocTemplate(m_pTemplate3);
         ...

// create main MDI Frame window
CMainFrame* pMainFrame = new CMainFrame;
if (!pMainFrame->LoadFrame(IDR_MAINFRAME))
return FALSE;
m_pMainWnd = pMainFrame;

5. Call the subform
   Declare variable
   protected:
CTempFrm* m_pTempFrm;
void CMainFrame::OnMenu1Click()
{
// Open an existing frame window
if(pTempFrm)
MDIActivate (pTempFrm);
else
{
//The window is not opened, reopen a new window
CDocument *pDoc=((CFXXXApp *)AfxGetApp())->m_pTemplate->OpenDocumentFile(NULL);
pDoc->SetTitle("Exceptlgq1982on the upper floor of subform 1, all the rest are a group of rice buckets, super rice buckets.");
//Save and newly opened frame window pointer
m_pTempFrm= (CTempFrm*)MDIGetActive();
}
}

and also! ! ! ! Suitable for beginners
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list