Visual C ++MFC Guide (3) Environment

zhaozj2021-02-11  155

Visual C / MFC Guide Third Category: Visual C IDE and Workspaces

Windows programming is a very difficult thing, don't be confused. Fortunately, Microsoft provides an IDE environment, called developer's Studio, collects compile, join, help, write code, and also provides visualized environments to make you a beautiful dialog.

There are some things you should know. First, it is also the most important, use online help. Because Windows's function is too much, you will find that you have 50% of your time in a few months. If you use VC6.0, you will need MSDN to be used as a help. Be sure to get it.

Next, it is said that the most important combination of key ctrl-w is used to open 'Class Wizard'. This thing will insert the code for you in the project. It handles all function code associated with the message.

Look at the Resource View. This is used to design dialog boxes. You can drag the button on the top, double-click to design your programs there. Use Class Wizard, you can do half the job. The rest is to fill in the function to handle the message of the button.

Now you should know how to start writing a new program. Let's write a real code. Select New in the File menu, see the Projects tab, select the MFC AppWizard. Enter your program name, press OK. Next, the most important thing is the first step, the type of program is selected. The simplest is 'Dialog Based', you should try, but now we first choose 'Dialog Based', the following steps accept the default settings. New files have been completed, but no matter it.

Place some buttons in Resource View in the dialog box. Play one first. When you feel good, choose 'Build' to compile the project, run again (I usually press CTRL-F5, compile and run the project. All programs must be compiled. Ok ~, the program is running.

There are some techniques for Ide. If you right to click the menu bar, a dialog box will pop up. Select 'Customize', this is useful, you can customize the menu and toolbar by dragging. A good way to customize your main toolbar and look comfortable. There is only one toolbar, there are so some buttons: Save, Save All, Compile, Build, Stop Build, Rebuild All, Set Active Configuration, Find, Find, Set Break Point, Remove, Set Break Point, Remove Break Point, Tile Windows, Find in Help.

转载请注明原文地址:https://www.9cbs.com/read-6015.html

New Post(0)