文档介绍:Preface
8QGHUVWDQGLQJ
'&20
%\ :LOOLDP 5XELQ DQG
0DUVKDOO %UDLQ
Copyright 1999 by Prentice Hall PTR
Prentice-Hall, Inc.
A Simon & pany
Upper Saddle River, NJ 07458
Prentice Hall books are widely used by corporations and govern-
ment agencies for training, marketing and resale.
The publisher offers discounts on this book when ordered in
bulk quantities. For more information, contact Corporate Sales
Department, Phone: 800-382-3419; fax: 201-236-7141;
email: corpsales@
Or write Corporate Sales Department, Prentice Hall PTR, One
Lake Street, Upper Saddle River, NJ 07458.
Product pany names mentioned herein are the trade-
marks or registered trademarks of their respective owners.
All rights reserved. No part of this book may
be reproduced, in any form or by any means,
without permission in writing from the publisher.
ISBN 0-13-095966-9
This electronic version of the book is provided strictly for use by
customers who have purchased the printed version of the book
and should not be reproduced or distributed in any way.
CONTENTS
Preface xiii
ONE The Basics 1
Classes and Objects 1
Is Different 3
COM can Run Across Processes 3
COM Methods Can Be Called Across work 4
COM Objects Must Be Unique Throughout the World 5
COM is Language Indpendent 5
COM Vocabulary 5
The Interface 7
Interfaces Isolate the Client From the Server 8
Imagine ponent 10
What's in a Name? 10
The Source of All Interfaces - IUnknown 10
A Object 11
How to Be Unique - the GUID 12
Server 14
Interactions Between Client and Server 15
Summary 16
TWO Understanding the
Client 19
Four Steps to Client Connectivity 20
Initializing Subsystem: 21
for a Specific Interface 22
Execute a Method on the Interface. 24
Release the Interface 24
Summary 25
vi Contents
THREE Understanding a Server 27
Where's the Code? 28
Building a DLL-Based (In-Process) COM Server 29
Creating the Server Using the ATL Wizard 30
Adding Object 33
Adding a Method to the Se