Microsoft Visual C++ Windows Applications by Example Code and Explanation for Real-World MFC C++ Applications Stefan Björnander BIRMINGHAM - MUMBAI Microsoft Visual C++ Windows Applications by Example Copyright © 2008 Packt Publishing All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews. Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, Packt Publishing, nor its dealers or distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book. Packt Publishing has endeavored to provide trademark information about all the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information. First published: June 2008 Production Reference: 1170608� �������� Published by Packt Publishing Ltd. 32 Lincoln Road Olton Birmingham, B27 6PA, UK. ISBN 978-1-847195-56-2 www.packtpub.com Cover Image by karl.moore (
[email protected]) Credits Author Stefan Björnander Reviewer S. G. Ganesh Senior Acquisition Editor David Barnes Development Editor Swapna V. Verlekar Technical Editor Bhupali Khule Editorial Team Leader Akshara Aware Project Manager Abhijeet Deobhakta Project Coordinator Brinell Catherine Lewis Indexer Monica Ajmera Proofreader Angie Butcher Production Coordinator Shantanu Zagade Cover Work Shantanu Zagade About the Author Stefan Björnander is a Ph.D. candidate at Mälardalen University, Sweden. He has worked as a software developer and has taught as a senior lecturer at Umeå University, Sweden. He holds a master's degree in computer science and his research interests include compiler construction, mission-critical systems, and model-driven engineering. You can reach him at
[email protected] I dedicate this book to my parents Ralf and Gunilla, my sister Catharina, her husband Magnus, and their son Emil About the Reviewer S. G. Ganesh is currently working as a research engineer in Siemens Corporate Technology, Bangalore. He works in the area of Code Quality Management (CQM). He has good experience in system software development having worked for around five years in Hewlett-Packard's C++ compiler team in Bangalore. He also represented the ANSI/ISO C++ standardization committee (JTC1/SC22/WG21) from 2005 to 2007. He has authored several books. The latest one is 60 Tips for Object Oriented Programming (Tata-McGraw Hill/ISBN-13 978-0-07-065670-3). He has a master's degree in computer science. His research i