Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

Microsoft Visual C++ .NET Professional Projects - Premier Press

.pdf
Скачиваний:
168
Добавлен:
24.05.2014
Размер:
25.78 Mб
Скачать

 

 

Y

 

L

 

F

 

M

 

A

 

E

 

T

 

 

VC++

Professional Projects

This page intentionally left blank

Sripriya and

Sai Kishore

WITH

VC++

Professional Projects

TM

©2002 by Premier Press, Inc. All rights reserved. No part of this book may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage or retrieval system without written permission from Premier Press, except for the inclusion of brief quotations in a review.

The Premier Press logo, top edge printing, and related trade dress are trademarks of Premier Press, Inc. and may not be used without written permission. All other trademarks are the property of

TM their respective owners.

Important: Premier Press cannot provide software support. Please contact the appropriate software manufacturer’s technical support line or Web site for assistance.

Premier Press and the author have attempted throughout this book to distinguish proprietary trademarks from descriptive terms by following the capitalization style used by the manufacturer.

Information contained in this book has been obtained by Premier Press from sources believed to be reliable. However, because of the possibility of human or mechanical error by our sources, Premier Press, or others, the Publisher does not guarantee the accuracy, adequacy, or completeness of any information and is not responsible for any errors or omissions or the results obtained from use of such information. Readers should be particularly aware of the fact that the Internet is an ever-changing entity. Some facts may have changed since this book went to press.

ISBN: 1-931841-31-4

Library of Congress Catalog Card Number: 2001096999

Printed in the United States of America

02 03 04 05 06 RI 10 9 8 7 6 5 4 3 2 1

Publisher:

Stacy L. Hiquet

Marketing Manager:

Heather Buzzingham

Managing Editor:

Sandy Doell

Editorial Assistant:

Margaret Bauer

Book Production Services:

Argosy

Cover Design:

Mike Tanamachi

About NIIT

NIIT is a global IT solutions corporation with a presence in 38 countries. With its unique business model and technology-creation capabilities, NIIT delivers software and learning solutions to more than 1,000 clients across the world.

The success of NIIT’s training solutions lies in its unique approach to education. NIIT’s Knowledge Solutions Business conceives, researches, and develops all of its course material. A rigorous instructional design methodology is followed to create engaging and compelling course content.

NIIT trains over 200,000 executives and learners each year in information technology areas using stand-up training, video-aided instruction, computer-based training (CBT), and Internet-based training (IBT). NIIT has been featured in the Guinness Book of World Records for the largest number of learners trained in one year!

NIIT has developed over 10,000 hours of instructor-led training (ILT) and over 3,000 hours of Internet-based training and computer-based training. IDC ranked NIIT among the Top 15 IT training providers globally for the year 2000. Through the innovative use of training methods and its commitment to research and development, NIIT has been in the forefront of computer education and training for the past 20 years.

Quality has been the prime focus at NIIT. Most of the processes are ISO-9001 certified. It was the 12th company in the world to be assessed at Level 5 of SEI-CMM. NIIT’s Content (Learning Material) Development facility is the first in the world to be assessed at this highest maturity level. NIIT has strategic partnerships with companies such as Computer Associates, IBM, Microsoft, Oracle, and Sun Microsystems.

This page intentionally left blank

About the Authors

Sripriya is an MCSD and has been working in various capacities as a technical trainer, technical writer, instructional designer, and an ID reviewer since August 1997. Sripriya has three years of experience in teaching various career programs at NIIT’s Career Education Group division. She has taught various technical subject areas, including Networking Essentials, SQL Server 6.5, Microsoft Windows NT Server 4.0, Windows 95, Windows 98, Microsoft Office 97 and 2000, Microsoft Visual Basic 6.0, Microsoft Visual C++ 4.0, Windows 32 API programming, HTML, Microsoft Visual Java, Unix, C, and C++. She has also set up and managed labs for students and has administered Novell 3.11 and UNIX (SCO)–based networks.

Sai Kishore is a programmer with six years of experience teaching programming. He currently works at the Knowledge Solutions Business of NIIT as a consultant and develops e-learning applications for various platforms. Previously, he was a technical trainer who conducted training on C, C++, Unix systems programming, Powerbuilder, DB-Library, Pro C (Oracle), Windows programming using C, Visual C++, and Visual Basic.

This page intentionally left blank

Contents at a Glance

Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxix

Part I Introducing VC++.NET . . . . . . . . . . . . . . . . . . . 1

1 Basics of .NET Framework . . . . . . . . . . . . . . . . . . . . . . . . . 3 2 Basics of VC++.NET Programming . . . . . . . . . . . . . . . . . 19 3 Creating a User Interface. . . . . . . . . . . . . . . . . . . . . . . . . . 49 4 Working with Menus, Dialog Boxes, and Window Controls. 71 5 The Document/View Architecture . . . . . . . . . . . . . . . . . . 99 6 Threads. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133

Part II

Professional Project – 1 . . . . . . . . . . . . . . .

155

7 Database Management Using ODBC – An Overview . . . 159 8 Implementing Data Access Technologies . . . . . . . . . . . . . 173 9 Debugging and Exception Handling in VC++.NET . . . . 263

Part III

Professional Project – 2 . . . . . . . . . . . . . . .

297

10 Introduction to Managed Extensions. . . . . . . . . . . . . . . . 301 11 Introduction to GDI+, Events, and Delegates . . . . . . . . . 319 12 Creating a Managed Extensions Application . . . . . . . . . . 347

Part IV

Professional Project – 3 . . . . . . . . . . . . . . .

441

 

13

Introduction to ADO.NET. . . . . . . . . . . . . . . . . . . . . .

. 445

 

14

Implementing ADO.NET in a Managed C++ Application. 469

Part V

Professional Project – 4 . . . . . . . . . . . . . . .

503

15 Introduction to ASP.NET . . . . . . . . . . . . . . . . . . . . . . . . 507 16 Creating a Class Library and Using It in an

ASP.NET Application . . . . . . . . . . . . . . . . . . . . . . . . . . 541

Part VI

Professional Project – 5 . . . . . . . . . . . . . . .

555

17 Introduction to COM . . . . . . . . . . . . . . . . . . . . . . . . . . . 559