| |

VerySource

 Forgot password?
 Register
Search
View: 961|Reply: 6

CMDIChildWnd child window problem

[Copy link]

1

Threads

3

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-1-7 10:40:01
| Show all posts |Read mode
I have an MDI program, what if I want to create 4 CMDIChildWnd child windows from the beginning? It seems that in the MFC examples are all dynamically created using the OnFileNew command.
More importantly, I want to put a Dialog in each CMDIChildWnd child window. How can I achieve this?
Reply

Use magic Report

0

Threads

4

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-1-7 12:30:01
| Show all posts
Add the dialog class directly and call it in the child window.
Reply

Use magic Report

1

Threads

3

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

 Author| Post time: 2020-1-7 13:45:01
| Show all posts
So how can you create 4 child windows at the beginning? How to call dialog in the child window?
Reply

Use magic Report

0

Threads

24

Posts

19.00

Credits

Newbie

Rank: 1

Credits
19.00

 China

Post time: 2020-1-7 23:09:01
| Show all posts
The first technique:
AfxGetMainWnd ()-> SendMessage (WM_COMMAND, IF_FILE_NEW);
Second technology:
Use document templates to open new files

CMultiDocTemplate * ptTemplate;
// Save the pointer of the file template class to ptTemplate
ptTemplate-> OpenDocumentFile (NULL);
Reply

Use magic Report

1

Threads

9

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-7-11 12:00:02
| Show all posts
A group of rice barrels upstairs, who can read it so simple
Reply

Use magic Report

0

Threads

5

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 China

Post time: 2020-7-11 14:45:01
| Show all posts
I don't understand, it's because your own skills are not enough, and you say others!
Reply

Use magic Report

1

Threads

3

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

 Author| Post time: 2020-7-23 18:45:01
| Show all posts
asty521is right, add the dialog directly, and then change the inheritance from CDialog to CFormView.
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