
上QQ阅读APP看书,第一时间看更新
Chapter 3. Windows Development
The development environment of choice in this book is the Visual Studio from Microsoft. In this chapter we also study the Microsoft Foundation Classes (MFC).
- Visual Studio provides us with a few Wizards—tools that help usgenerate code. The Application Wizard creates an application framework(a skeleton application) to which we add the specific logic and behaviorof our application.
- When developing a Windows application, the Document/View model comes in handy. The application is divided into a document object that holds the data and performs the logic, and one or more views that take care of user input and display information on the screen.
- When an event occurs (the user clicks the mouse, the window is resized) a message is sent to the application, it is caught by a view object and is passed on to the document object. There are hundreds of messages in the Windows system. However, we only catch those that interest us.
- The device context can be viewed both as a canvas to paint on and as a toolbox holding pens and brushes.
- When we finish an application, we may want it to occur in the same state when we launch it the next time. This can be archived by storing vital values in the registry.
- Serialization is an elegant way of storing and loading values to and from a file. The framework takes care of naming, opening, and closing the file, all we have to do is to fill in the unique values of the application.
- The cursor has different appearances on different occasions. There are several predefined cursors we can use.