Learning DCOM - Helion
ISBN: 978-14-493-0868-1
stron: 504, Format: ebook
Data wydania: 2016-03-18
Księgarnia: Helion
Cena książki: 101,15 zł (poprzednio: 117,62 zł)
Oszczędzasz: 14% (-16,47 zł)
DCOM -- the Distributed Component Object Model -- is a recent upgrade of a time-honored and well-tested technology promoted by Microsoft for distributed object programming. Now that components are playing a larger and larger part in Windows 98, Windows NT 4.0, and Windows 2000, every Windows programmer will want to understand the technology. DCOM competes with CORBA as a rich and robust method for creating expandable and flexible components, allowing you to plug in new parts conveniently and upgrade without the need for code changes to every program that uses your component.This book introduces C++ programmers to DCOM and gives them the basic tools they need to write secure, maintainable programs. While using Visual C++ development tools and wizards where appropriate, the author never leaves the results up to magic. The C++ code used to create distributed components and the communications exchanged between systems and objects are described at a level where the reader understands their significance and can use the insights for such tasks as debugging and improving performance.The first few chapters explain both the remote procedure calls that underlie DCOM's communication and the way DCOM uses C++ classes. Readers become firmly grounded in the relation between components, classes, and objects, the ways objects are created and destroyed, how clients find servers, and the basics of security and threading.After giving you a grounding in how DCOM works, this book introduces you to the Microsoft tools that make it all easy. By showing what really happens each time you choose a button in a wizard, Learning DCOM makes it possible for you to choose what you need.This book is for anyone who wants to understand DCOM. While thoroughly practical in its goals, it doesn't stint on the background you need to make your programs safe, efficient, and easy to maintain.Topics include:
- MIDL (Microsoft Interface Definition Language, the language for defining COM interfaces)
- COM error and exception handling
- Custom, dispatch, and dual interfaces
- Standard and custom factories
- Management of in-process versus out-of-process servers
- Distributed memory management
- Pragmatic explanation of the DCOM wire protocol
- Standard, custom, handler, and automation marshaling
- Multithreading and apartments
- Security at the system configuration and programming level
- Active Template Library (ATL), ATL wizards -- and what they don't do
- Writing a component that can be invoked from Visual Basic
- Techniques for using distributed components
- Creating an ActiveX control and embedding it in a Web client
- Authentication and the use of Windows NT security features
- Techniques for merging marshaling code
- Connection and distributed events management
- An introduction to COM+ features
Osoby które kupowały "Learning DCOM", wybierały także:
- Zosta 149,00 zł, (44,70 zł -70%)
- Metoda dziel i zwyci 89,00 zł, (26,70 zł -70%)
- Matematyka. Kurs video. Teoria dla programisty i data science 399,00 zł, (119,70 zł -70%)
- Design Thinking. Kurs video. My 129,00 zł, (38,70 zł -70%)
- Konwolucyjne sieci neuronowe. Kurs video. Tensorflow i Keras w rozpoznawaniu obraz 149,00 zł, (44,70 zł -70%)
Spis treści
Learning DCOM eBook -- spis treści
- Learning DCOM
- SPECIAL OFFER: Upgrade this ebook with OReilly
- A Note Regarding Supplemental Files
- Preface
- Scope of This Book
- Some Assumptions About the Reader
- Accompanying Source Code
- FTP
- FTPMAIL
- Conventions
- Related Sources of Information
- Specifications and References
- The Classics
- Knowledge Base Articles
- Technical Articles
- Other Related Documentation
- Acknowledgments
- 1. Distributed Computing
- Dumb Terminals
- Client/Server Computing
- Distributed Computing Using RPC
- Distributed Objects
- Distributed Components
- 2. Distributed COM Overview
- COM
- The Object-Oriented Model
- Encapsulation
- Inheritance
- Polymorphism
- The Client/Server Model
- The Object-Oriented Model
- Distributed COM
- COM Facilities and Services
- Location Transparency
- Dynamic and Remote Object Activation
- Security
- Interfaces
- Lifetime Support and Dynamic Discovery
- Binary Interoperability
- Connection Management
- Concurrency Management
- Reuse
- Interface Repository
- Implementation Repository
- Static Invocation
- Dynamic Invocation
- Events
- Applying COM
- COM
- 3. Objects
- Interfaces
- IUnknown
- Microsoft Interface Definition Language
- MIDL basics
- Defining a custom interface using MIDL
- Examining the attributes of IUnknown
- Arrays and strings as interface method parameters
- Custom types as interface method parameters
- Adding more custom interfaces
- Defining a type library
- Published interfaces must never change
- Return Values
- HRESULT
- Custom HRESULTs
- Data Types
- Base data types
- Automation compatible types
- Interface Marshalers: Proxy and Stub
- The Binary Layout
- Dispatch and Dual Interfaces
- An Interface Recap
- Objects
- Implementing Interfaces
- IUnknown Rules
- Identity rules
- Existence rules
- Implementing COM Objects
- COM object definition using the nested classes technique
- COM object definition using the multiple inheritance technique
- Implementing IUnknown methods
- Implementing other interface methods
- Class Factories
- Standard Factories
- Custom Factories
- Interfaces
- 4. Components
- Servers
- Server Types
- Out-of-process servers
- In-process servers
- Initialization and Termination
- Out-of-process servers
- In-process servers
- Dynamic Activation Support
- Out-of-process servers
- In-process servers
- Component Lifetime
- Out-of-process servers
- In-process servers
- Implementation Registration
- Out-of-process servers
- In-process servers
- Registering interface marshalers
- Server Types
- Clients
- Initialization and Termination
- Creating an Object
- CoCreateInstance
- CoCreateInstanceEx
- CoGetClassObject
- Class monikers
- Initializing an Object
- Using an Object
- Deleting an Object
- In- and Out-of-Process Issues
- Object Orientation
- Encapsulation
- Polymorphism
- Reuse
- Containment
- Aggregation
- Using objects that support aggregation
- Developing objects that support aggregation
- Servers
- 5. Infrastructure
- Memory
- Simple Data Types and Top-Level Pointers
- Secondary and Embedded Pointers
- COM API functions for distributed memory management
- Managing embedded pointers
- Character Pointers
- Automation Data Types
- Memory management for a BSTR
- Memory management for a SAFEARRAY
- Transparency
- Structure of a Marshaled Interface Reference
- Activation
- Standard Marshaling
- More on activation
- Remote invocation
- Custom Marshaling
- The objects responsibility
- The custom proxys responsibility
- Handler Marshaling
- Automation Marshaling
- Remote Connection Management
- Concurrency
- Single-Threaded Apartment
- Basic requirements
- Synchronization
- Other issues
- Sharing Interface Pointers Among Apartments
- Multithreaded Apartment
- Basic requirements
- Synchronization
- Other issues
- Out-of-Process Server Considerations
- In-Process Server Considerations
- ThreadingModel= (default)
- ThreadingModel=Apartment
- ThreadingModel=Free
- ThreadingModel=Both
- Free-Threaded Marshaler
- Performance
- Single-Threaded Apartment
- Security
- Configurable Security
- Machine-wide security
- Application-wide security
- Application identity
- Programmable Security
- General application-wide security on both the client and server side
- Access security on the server side
- Activation security on the client side
- Call-level security on the client side
- Using the security context on the server side
- Configurable Security
- Memory
- 6. Building Components with ATL
- Creating a Component
- Adding an Object
- The Generated Code
- Generated Interface
- Generated Implementation
- Common Responsibilities
- Implementing Interface Methods
- Adding a Custom Interface
- Adding Another Dual Interface
- Finishing Up
- 7. Using COM Objects
- Simple Client
- Initializing and Uninitializing COM
- Creating the User Interface
- The COleDispatchDriver Technique
- Creating an Interface Wrapper Class
- The COleDispatchDriver Class
- Using COM Interfaces with Generated Wrappers
- The #import Technique
- The #import Statement
- Using COM Interfaces with Smart Pointers
- Native C++ Compiler Features
- More on smart pointers
- Exception handling
- The Manual Technique
- Remote Activation API Functions
- Using COM Interfaces Manually
- The Reusable echnique
- The RemotePtr Class
- Using the RemotePtr Class
- Review
- Simple Client
- 8. COM in Cyberspace
- ATL ActiveX Controls
- Creating the Project
- Adding an ActiveX Control
- Merging the Proxy/Stub Code
- Adding Properties
- Adding Methods
- Step 1: Merging the proxy/stub code for external (remote) interfaces
- Step 2: Reusing the RemotePtr class
- Step 3: Coding the OcrImage method
- Web-Enabled Clients
- Control Buttons
- Server Name and Image Location
- Wang Image Edit ActiveX Control
- OCR Results
- ATLCyberOcr ActiveX Control
- Complete HTML and VBScript Source Code
- Problems with COM over the Internet
- Problems with security
- Problems with firewalls or proxy servers
- MFC Composites
- Creating an MFC ActiveX Control Project
- Understanding the generated code
- Creating the user interface
- Using an ActiveX control within an ActiveX control
- Implementing the ActiveX Control: CMFCCyberServerCtrl
- CMFCCyberServerCtrl::OnCreate
- CMFCCyberServerCtrl::OnDraw
- Implementing CImagingWindow
- CImagingWindow::OnCreate
- CImagingWindow::OnSize
- Handling command messages
- Creating an MFC ActiveX Control Project
- ATL Composites
- Creating the Project
- Adding a Composite Control
- Creating the User Interface
- Putting common controls onto the composite
- Putting ActiveX controls onto the composite
- Testing the user interface
- Implementation
- Importing the embedded ActiveX control
- Adding command handlers in ATL
- Testing the final product
- ActiveX Control Properties
- Playing with Property Pages
- Step 1: Creating the application
- Step 2: Adding the two views
- Step 3: Adding a splitter window
- Step 4: Putting the two ActiveX controls on their appropriate views
- Step 5: Showing the property pages
- Adding a Property to CMFCCyberServerCtrl
- Playing with Property Pages
- ATL ActiveX Controls
- 9. Applying Security
- Server-Side COM Security
- Creating the Project and a COM Object
- Implementing the SecureOcrImage Method
- Validating the Invocation
- Access Token
- Constructor and Destructor
- Getting the Access Token
- Getting User Information
- Getting Group Information
- Audit Trail
- Creating Message Files
- Creating a message file for your component
- Compiling a message file
- Updating the Registry with Event Source Information
- Logging Messages
- Creating Message Files
- Administrative Alert
- Administrative Alert Setup
- Generating an Administrative Alert
- Client-Side Security
- Setting the Authentication Identity
- Setting the Process-Wide Security
- Merging Proxy/Stub Code into a Client EXE Component
- Using Activation Security
- Using Call Security
- Handling Errors
- Testing and Understanding COM Security
- Test Scenario IObserving call-level security and logged events
- Test Scenario IIObserving administrative alerts
- Test Scenario IIIObserving activation security
- Server-Side COM Security
- 10. Connecting Objects
- Object Reference
- Referrers
- Creating the ChatBroker Component
- Adding a Broker COM Object
- The IRegisterChatServer interface
- The IDiscussions interface
- Caching a List of Discussions
- CChatDiscussionList::AddDiscussion
- CChatDiscussionList::RemoveDiscussion
- CChatDiscussionList::GetDiscussionList
- CChatDiscussionList::GetChatServer
- CChatDiscussionList::GetSize
- ChatBrokers special condition for component lifetime management
- Implementing the Interface Methods
- Merging Proxy/Stub Code into a Server EXE Component
- Connection Points
- Event Sources
- Creating an Event Source Object
- Adding a Connection Point
- Step 1: Define a callback interface using MIDL
- Step 2: Implement a connection point object
- Step 3: Add a connection point to the event source object
- Receiving and Disseminating a Chat Message
- The Responsibility of the ChatServer Application
- Handling of command-line options
- Registering interface marshalers
- Opening and closing the discussion
- Running the ChatServer
- Event Sinks
- Creating the ChatClient Project
- Creating the user interface and adding command handlers
- Merging proxy/stub code into a project without an IDL File
- Connecting to and Disconnecting from a ChatBroker
- Joining and Leaving a Chat Discussion
- Sending a Chat Message
- Receiving Chat Messages
- Creating the ChatClient Project
- Performance Impact of Connection Points
- Security Impact of the OBJREF
- A. Debugging Techniques
- Using the FormatMessage Function
- Using the _com_error Class
- Breaking into the Server
- B. Performance
- Performance Results for ThreadingModel=
- Performance Results for ThreadingModel=Apartment
- Performance Results for ThreadingModel=Free
- Performance Results for ThreadingModel=Both
- C. New COM Features and COM+
- Endpoint Configuration
- Nonblocking Calls
- COM+
- Runtime that Simplifies Component Development and Usage
- Hide nonbusiness logic complexities
- Simplify component development and usage
- Services that Support Large-Scale Enterprise Needs
- Runtime that Simplifies Component Development and Usage
- D. Hello, Universe!
- Client/Server Protocol = COM Interface
- Client Component
- Server Component
- The main( ) routine
- The Class Factory
- The COM Object
- Comforting Words
- Index
- Colophon
- SPECIAL OFFER: Upgrade this ebook with OReilly