📄 readme.htm
字号:
<!--TO READ THIS HELP FILE, RIGHT-CLICK ON THE FILE NAME IN THE
SOLUTION EXPLORER PANE AND SELECT "VIEW IN BROWSER"-->
<html><head><title>MDIDOCVW Sample: Demonstrates MDI Using Doc/View Architecture</title></head><body><h1>MDIDOCVW Sample: Demonstrates MDI Using Doc/View Architecture</h1><div id="mainSection"><div id="mainBody"><div id="allHistory" class="saveHistory" onsave="saveAll()" onload="loadAll()"></div><p /><p>The MDIDOCVW sample uses MFC's multiple-document interface (MDI) support and the document/view architecture. The sample contains two document types: Hello (which prints out a string in a view) and Bounce (which displays a bouncing ball of color in a view). MDIDOCVW also illustrates the Microsoft Windows timer, <b>CColorDialog</b>, <b>CBitmap</b>, and changing the default cursor of a window.</p><p>The MDIDOCVW sample provides a parent window with two distinct types of MDI child windows: a Bounce window, in which a ball bounces around; and a Hello window, which simply displays the text "Hello, World!"</p><p>For a sample that uses MDI support without the document/view architecture, see MDI.</p><div class="alert"><table width="100%" cellspacing="0" cellpadding="0"><tr><th align="left">Security Note </th></tr><tr><td><p>This sample code is provided to illustrate a concept and should not be used in applications or Web sites, as it may not illustrate the safest coding practices.</p></td></tr></table></div><h1 class="heading">Building and Running the Sample</h1><div id="sectionSection0" class="seeAlsoNoToggleSection"><h4 class="subHeading">To build and run the MDIDOCVW sample</h4><div class="subSection"><ol><li><p>Open the solution mdi.sln.</p></li><li><p>On the <b>Build</b> menu, click <b>Build</b>. </p></li><li><p>On the <b>Debug</b> menu, click <b>Start Without Debugging</b>. </p></li></ol></div><p>Click <b>New Bounce</b> or <b>New Hello</b> on the <b>File</b> menu to create a new MDI child window. Both types of MDI child windows determine what menus are shown when they are active. Both types of windows have a <b>Color</b> menu. When you choose a color from this menu, the color of the bouncing ball or of the Hello text is updated. Click <b>Custom</b> to call a <b>Color</b> dialog box, from which you can select a custom color.</p><p>The Bounce window also has a <b>Speed</b> menu, from which you can select the speed the ball moves around the screen.</p><p>A toolbar implements most of the menu commands. The toolbar also implements check box buttons for the five basic colors.</p></div><h1 class="heading">Changing the Default Cursor</h1><div id="sectionSection1" class="seeAlsoNoToggleSection"><p>Although <b>CBounceView</b> and <b>CHelloView</b> both override <b>Create</b>, the override is not necessary to take advantage of the framework's MDI support. The override of <b>Create</b>, found in the <b>CBounceView </b>class, illustrates how to change the default cursor. Changing the default cursor of a window requires registering a new <b>WNDCLASS</b> by calling <b>AfxRegisterWndClass</b> and passing the name of the <b>WNDCLASS</b> in the call to <b>Create</b>.</p></div><h1 class="heading">Keywords</h1><div id="sectionSection2" class="seeAlsoNoToggleSection"><p>This sample demonstrates the following keywords:</p><p>AfxRegisterWndClass; CBitmap::CreateCompatibleBitmap; CCmdUI::SetCheck; CColorDialog::DoModal; CColorDialog::GetColor; CDC::BitBlt; CDC::CreateCompatibleDC; CDC::DeleteDC; CDC::DrawText; CDC::Ellipse; CDC::FillRect; CDC::GetDeviceCaps; CDC::SelectObject; CDC::SetBkColor; CDC::SetTextColor; CFrameWnd::LoadFrame; CFrameWnd::rectDefault; CGdiObject::DeleteObject; CMDIChildWnd::Create; CWinApp::InitInstance; CWnd::DestroyWindow; CWnd::GetClientRect; CWnd::GetCurrentMessage; CWnd::GetDC; CWnd::KillTimer; CWnd::MessageBox; CWnd::OnCreate; CWnd::OnSize; CWnd::OnTimer; CWnd::ReleaseDC; CWnd::SetTimer; CWnd::ShowWindow; CWnd::UpdateWindow; GetSysColor; LOWORD; RGB; max; min</p><div class="alert"><table width="100%" cellspacing="0" cellpadding="0"><tr><th align="left">Note </th></tr><tr><td><p>Some samples, such as this one, have not been modified to reflect the changes in the Visual C++ wizards, libraries, and compiler, but still demonstrate how to complete your desired task. </p></td></tr></table></div></div></div><div id="footer"><div class="footerLine"></div>
© Microsoft Corporation. All rights reserved. Send <a href="mailto:DevDocs@microsoft.com?subject=Documentation Feedback :MDIDOCVW Sample: Demonstrates MDI Using Doc/View Architecture">comments</a> about this topic to Microsoft.
</div></div></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -