Programming with Microsoft Visual C++ .NET, Sixth Edition
George Shepherd with David Kruglinski
PUBLISHED BYMicrosoft PressA Division of Microsoft CorporationOne Microsoft WayRedmond, Washington 98052-6399Copyright © 2003 by George ShepherdAll rights reserved. No part of the contents of this book may be reproduced or transmitted in any form or by any means without the written permission of the publisher.Library of Congress Cataloging-in-Publication Data Shepherd, George
Programming with Microsoft Visual C++ .NET, Sixth Edition (Core Reference) / George Shepherd.p. cm.Includes index.ISBN 0-7356-1549-72002
1 2 3 4 5 6 7 8 9 QWT 7 6 5 4 3 2Distributed in Canada by H.B. Fenn and Company Ltd.A CIP catalogue record for this book is available from the British Library.Microsoft Press books are available through booksellers and distributors worldwide. For further information about international editions, contact your local Microsoft Corporation office or contact Microsoft Press International directly at fax (425) 936-7329. Visit our Web site at www.microsoft.com/mspress. Send comments to: mspinput@microsoft.com.ActiveX, FoxPro, IntelliSense, Microsoft, Microsoft Press, MSDN, MS-DOS, Visio, Visual Basic, Visual C++, Visual Studio, Win32, and Windows are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries. Other product and company names mentioned herein may be the trademarks of their respective owners.The example companies, organizations, products, domain names, e-mail addresses, logos, people, places, and events depicted herein are fictitious. No association with any real company, organization, product, domain name, e-mail address, logo, person, place, or event is intended or should be inferred.Acquisitions Editors: Juliana Aldous and Danielle BirdProject Editor: Denise BankaitisTechnical Editor: Julie Xiao Body Part No. X08-68165Dedicated to Sandy Daston and Ted Shepherd
Acknowledgments
This part of book writing is always the best— everybody involved is nearly done with the manuscript and all that's left to do is to thank everybody. Because the author's name appears on the cover, it's sometimes easy to forget all the other folks involved in a project as large as this. Many other folks gave their time and energy to this project, and I wish to thank you.Thank you Sandy Daston and Ted Shepherd—my family, for your support while I wrote this book.Thank you, Denise Bankaitis. As the project editor, you kept me going by reminding me of the importance of this project (a key C++ reference for .NET) and by coordinating the efforts of the rest of the team, which includes Julie Xiao, Ina Chang, Danielle Bird, Juliana Aldous, Joel Panchot, Carl Diltz, and Gina Cassill.Thank you, Julie Xiao, for keeping the manuscript accurate.Thank you, Ina Chang, for making my sentences readable.Thank you, Danielle Bird and Juliana Aldous. As acquisition editors, you got this project rolling and kept it on track.Thank you, Joel Panchot, for making sure the art in this book looks good.Thank you, Carl Diltz and Gina Cassill, for composing the manuscript and making it look great.I would also like to thank the folks at DevelopMentor, for providing a wonderful environment and community for thinking and learning about modern computing. You guys are wonderful.George ShepherdWhen George Shepherd isn't writing .NET components for Syncfusion ( http://www.syncfusion.com), he teaches short courses with DevelopMentor ( http://www.develop.com). George is a contributing editor for MSDN magazine, and the coauthor of several other books on working with Microsoft technologies. George now prefers to play his Hamer Artist between compiles (although .NETís new JIT compiling doesnít leave as much time for that).Drill Bit
The year was 1914, and the electric motor was still newfangled. Along came two bright young fellows, S. Duncan Black and Alonzo G. Decker, who saw its possibilities. They hooked one of the new motors up to a drill bit—a circular piece of metal with a chisel edge and cutting lips— and the world's first electric drill was born. It had a pistol grip and a trigger switch, and it made boring holes a snap, but it didn't really catch on until 20 years later when, in 1946, Black and Decker designed a model for consumers, and the tool took off. As usual, necessity was the mother of invention and the father of a highly successful company—a bit of wisdom you can drill home time and time again.[*]
At Microsoft Press, we use tools to illustrate our books for software developers and IT professionals. Tools very simply and powerfully symbolize human inventiveness. They're a metaphor for people extending their capabilities, precision, and reach. From simple calipers and pliers to digital micrometers and lasers, these stylized illustrations give each book a visual identity, and a personality to the series. With tools and knowledge, there's no limit to creativity and innovation. Our tag line says it all: The tools you need to put technology to work.The manuscript for this book was prepared and galleyed using Microsoft Word. Pages were composed by Microsoft Press using Adobe FrameMaker+SGML for Windows, with text in Garamond and display type in Helvetica Condensed. Composed pages were delivered to the printer as electronic prepress files.Cover Designer: Methodologie, Inc.Interior Graphic Designer: James D. KramerPrincipal Compositor: Gina CassillInterior Artist: Joel PanchotPrincipal Proofreader: Ina ChangIndexer: Julie Kawabata[*]From The Great Tool Emporium by David X. Manners (published by E.P. Dutton/Times Mirror Magazines, Inc., 1979)