Study Strategies

Create a COM component that implements business rules or logic. Components include DLLs, ActiveX controls, and active documents. For the first general objective ("Create a COM component that implements business rules or logic"), become familiar with the material discussed in this chapter's major sections: "Steps in Creating a COM Component," "Implementing Business Rules with COM Components," "Implementing an Object Model with a COM Component," and "Implementing COM Components Through Class Modules." Do Exercise 12.1.

For the objective that refers to threading models, see the section titled "Managing Threads in a COM Component" and Exercise 12.2. Choose the appropriate threading model for a COM component.

Compile a project with class modules into a COM component.

Implement an object model within a COM component.

Set properties to control the instancing of a class within a COM component.

Determine how to send error information from a COM component to a client computer. For the objective and subobjectives listed under "Compile a project with class modules," see the sections titled "Declaring and Using a Class Module Object in Your Application," "The Instancing Property of COM Component Classes," and "Handling Errors in the Server and the Client." Review Exercise 12.1 and do Exercises 12.3 and 12.4.

For the objective "Use Visual Component Manager to manage components," see the section and subsections under "Managing Components with Visual Component Manager." Complete Exercise 12.5. For the objective that refers to callback procedures, see the section titled "Providing Asynchronous Callbacks." Complete Exercise 12.6 For the objective that refers to registering and unregistering a COM component, see the section titled "Registering and Unregistering a COM Component." Complete Exercise 12.7. For the objective that refers to implementing messages from a server component to a user interface, see the section titled "Sending Messages to the User from a COM Component." Complete Exercise 12.8.

Getting Information About a COM Component Developers of potential client applications can find out about your server component by looking at the Windows Registry, or by using utilities such as VB's Object Browser.

You can register your server component in the Windows Registry in one of several ways. These ways are discussed in more detail in the section titled "Registering and Unregistering a COM Component."

A Visual Basic project provides an externally creatable object through certain project settings and by possessing a class module whose properties you have set appropriately.

An externally creatable object also typically provides a gateway to other objects that can't be directly created by clients. Every COM component provides at least one externally creatable object. The server component's externally creatable objects, together with the other objects indirectly exposed by the externally creatable objects, is known as an object hierarchy or object model.

You can implement your own COM component's object model with custom object classes. Although you can create custom object classes specific to a single application, Microsoft's published documentation and courseware are full of examples of classes used to implement COM components.

0 0

Post a comment