Visual C++ by Example cover

Visual C++ by Example

No rating yet
Chapters
19
Series
Programming by Example Lecture Hall
ISBN
9787111253341

Tags

Summary

Part of the Programming by Example Lecture Hall series from China Machine Press, this book uses Visual C++ 6.0 as its development environment and centers on Windows application development, embedding key concepts within runnable examples. The book follows a Knowledge Points → Implementation Code → Source Code Walkthrough structure. It begins with an introduction to the Visual C++ 6.0 development environment, starting from a first console program and a first Windows program, then moves on to dialog-based, single-document, and multiple-document MFC applications, so that beginners can get a project up and running first. In the controls and interface section, the book demonstrates the use of common Win32 controls one by one: static text, text boxes, buttons, check boxes, radio buttons, combo boxes, list boxes, scroll bars, progress bars, sliders, hot keys, list controls, tree controls, Rich Edit, property sheets, animation, date and time, month calendar, and IP address controls. It then enriches the interface with advanced controls such as menus, pop-up menus, toolbars, 256-color toolbars, and status bars, and introduces interface techniques including window creation, semi-transparent windows, elliptical windows, and shaped windows. Later chapters delve into the Windows message mechanism, system and shell programming, input devices such as keyboard and mouse, process management, graphics and imaging, file IO, databases, networking, multithreading and dynamic link libraries, multimedia, ActiveX, and application deployment. The book contains more than 200 typical examples. While explaining how to use the MFC class library, it also compares MFC with the SDK and basic APIs, helping readers not only use the methods but also understand the principles behind them. The book is accompanied by substantial video material and sample source code, making it suitable as an introductory textbook and desk reference for readers who already have some C++ background and wish to move into Windows platform development.

Editor's review

这是一本「拿实例当教材」的 VC 书。它的思路很朴素:每讲一个知识点,就给一个能编译、能运行的小程序,再逐段拆解源码,读者照着敲一遍,比啃概念更有效。对当年大量从 C++ 语言课走向 Windows 桌面开发的读者来说,这种「先跑通、再理解」的路径相当友好。 本书的优点在于覆盖面扎实。从开发环境的认识、MFC 程序框架,到控件、窗体、消息机制,再到图形、文件、数据库、网络和发布,一条线串起 Windows 开发的常见环节;把 MFC 与 SDK、Win32 API 相互对照的写法,也帮助读者弄清封装背后的原理。书中收录两百余个实例,示例源码与配套资料齐全,适合当作查得着的工具书。 需要提醒的是,本书以 Visual C++ 6.0 为开发环境,这是二十多年前的工具链,语法与 IDE 与现代 Visual Studio 差异较大;MFC 本身也已不是新项目的主流选择。因此它更适合作为理解 Windows 底层编程与 MFC 体系的历史性参考,而非当下的速成指南。若你追求新框架,请另觅书目;若你想理解 Win32 与 MFC 如何运作,这本书仍值得翻。

Who it's for

A good fit for

  • 已有 C++ 语法基础、想转入 Windows 平台开发的读者
  • 使用 MFC 维护旧项目、需要查控件与消息用法的开发者
  • 想通过实例理解 Win32 API 与 MFC 封装原理的自学者
  • 高校计算机专业学生作为 Windows 程序设计课程的辅助读物

Not a good fit for

  • 完全没有编程基础、连 C++ 语法都不熟悉的零起点读者
  • 只想要现代 Visual Studio 与 C++11/17 以上新特性内容的读者
  • 从事跨平台或 Web、移动开发的工程师

Reading tips

  1. 先读完第1章,亲手把控制台、对话框、单文档三个工程各建一遍,建立对 MFC 框架的直觉
  2. 控件和窗体章节不必从头读到尾,可对照手头项目需求挑实例做,边做边查
  3. 读 MFC 代码时顺手翻看对应的 Win32 API 写法,理解封装层次,收获会更大
  4. 把书中实例迁到自己可用的编译环境里试跑,过时的 API 调用及时替换并记录差异

About the publisher

China Machine Press China · Founded in 1950

In addition to science and technology and professional publishing, the books in our catalog from China Machine Press also reflect a sustained focus on psychology, computing, management, finance and economics, and social sciences. In psychology, the catalog includes works by C. G. Jung and introductions to analytical psychology, as well as applied topics such as stress and health, and addiction and healing. In computing, it features Structure and Interpretation of Computer Programs (JavaScript Edition). Management and finance titles include Administrative Behavior (4th Edition), The Price of Inequality (Collector's Edition), and This Time Is Different: Eight Centuries of Financial Folly (Commemorative Edition). In the philosophy and history of science, there is The Worldview: The Third Edition. Relevant authors include C. G. Jung, William McGuire, Sonu Shamdasani, and Gabor Maté. Public information is limited; the above summarizes the publisher's profile based solely on the books in our catalog.

Contents

  1. Preface to the Series
  2. Preface
  3. Chapter 1 Getting to Know Visual C++ 6.0 (Console Programs, Windows Programs, Dialog/Single-Document/Multiple-Document MFC Programs, Using Macros)
  4. Chapter 2 Using Common Win32 Controls (Static Text, Text Boxes, Buttons, Check Boxes, Combo Boxes, Scroll Bars, Progress Bars, Sliders, Hot Keys, Lists, Trees, Rich Edit, Property Sheets, Animation, Date and Time, Month Calendar, IP Address Controls)
  5. Chapter 3 Enriching the Interface with Advanced Win32 Controls (Window Menus, Pop-up Menus, Toolbars, 256-Color Toolbars, Status Bars, Color Gradient Progress Bars, ToolTips)
  6. Chapter 4 Windows (Creating and Displaying, Always on Top, Semi-Transparent, Elliptical Windows, Text Windows, Shaped Windows, Animated Show and Hide, Adaptive Controls)
  7. Chapter 5 Dialog Boxes
  8. Chapter 6 Understanding Windows Messages in Depth
  9. Chapter 7 System and Shell Programming
  10. Chapter 8 Basic Input Devices
  11. Chapter 9 Processes
  12. Chapter 10 Graphics and Image Development
  13. Chapter 11 File IO Development
  14. Chapter 12 Database Development
  15. Chapter 13 Network Development
  16. Chapter 14 Advanced Windows Programming
  17. Chapter 15 Multimedia Development
  18. Chapter 16 ActiveX Applications
  19. Chapter 17 Deploying Applications

FAQ

这本书用的是哪个版本的 Visual C++?
全书以 Visual C++ 6.0 为开发环境,配套的 MFC 类库也是那个年代的版本,与现代 Visual Studio 的默认项目模板和语法标准差别较大。
这本书和《Visual C++ 6.0实例精通》是同一本吗?
不是。后者由谢勇编写、科学出版社于2000年出版,讲的是面向工程的开发问题;本书由张军编著、机械工业出版社2009年出版,属于「编程实例大讲堂」系列。
书中的实例还能在新版 Visual Studio 上运行吗?
多数示例思路仍然适用,但 MFC 向导、部分 API 和工程文件格式已经变化。建议把新版 IDE 中对应的操作当作实践练习,理解逻辑而不必逐字照抄。
没有 C++ 基础可以直接读吗?
不推荐。书中的讲解默认读者掌握 C++ 语法与面向对象基础,直接上手容易在类、指针和消息映射上卡住,建议先补语言基础再读。

Comments

Find this book

This site is an index: you start “Search all sources” in your browser, and the entries it lists all point to third-party sites; please judge their availability yourself.

About the author

张军 Author

Zhang Jun is an author about whom limited public information is available. The library holds 22 of his works, spanning categories such as popular science, finance and economics, history, medicine, management, and examination preparation, which indicates a broad range of subjects. Representative titles include The Last Embrace: Animal and Human Emotions; Scaling the Peak: Understanding the Mechanisms of China's Economic Development; The Governance of China (8 volumes); Learning Electronics from Scratch; The Distant Empire: The Two Jins and Sixteen Kingdoms; Changing China: An Economist's Notes on Reform; The Age of Disorder; and The Historical Evolution of Virtual Economy Legislation: From Laissez-Faire to Limited Development. Judging from these titles, his writing balances academic themes with the needs of general readers, covering observations on China's economic mechanisms and reform process as well as historical narrative, animal emotions, and introductory electronics, with a style that develops arguments along clear lines and makes topics accessible to readers of different backgrounds.

More by the same author

Top rated in the same category