This section describes how to write the code for ActiveX components that run in EAServer.
When you code the parameters for each method, make sure you use the ActiveX datatypes that are supported by EAServer (see “ActiveX datatype support”).
IDL attributes are not supported by ActiveX components.
To write code for ActiveX components:
Implement the IDispatch interface – ActiveX components running on a server are nonvisual, that is, they do not display text or graphics. Consequently, many commonly used ActiveX interfaces are not required for creating ActiveX components in EAServer. ActiveX components running on EAServer need to support only the IDispatch interface. If you develop your component with an automation controller such as Visual Basic, the IDispatch interface is implemented transparently.
Implement the constructor and destructor. See “Implementing a constructor and destructor”.
Optionally, implement the IObjectControl interface – You can use this interface to determine, at runtime, whether to pool instances.
Implement methods to perform the following optional tasks:
Sharing data between components – Enable components to share properties between the same class’s instances.
Issuing intercomponent calls – Execute methods in other components.
Managing database connections – Connect to databases through connection caches by using the Connection Management API.
Sending result sets from an ActiveX component – Return result sets using the EAServer Result Sets API.
Setting transactional state – If your component is transactional, call IObjectContext methods to set the transaction state before returning.
Accessing SSL client certificates – If the client connected using SSL with mutual (client and server) authentication, you can retrieve the client certificate information in your component. See Chapter 8, “Using SSL in ActiveX Clients,” in the EAServer Security Administration and Programming Guide for more information.
Adding error-handling code – If errors occur in a method, raise an ActiveX automation exception. Add code that responds to errors by recording error details to the server log file and sending an exception to the client.
Copyright © 2005. Sybase Inc. All rights reserved. |