The Caché ActiveX binding provides access to Caché from any application that supports ActiveX objects. This binding allows you to instantiate and manipulate Caché objects within client applications, and provides a transparent interface to their server-side object instantiations. Examples in this book are written in Visual Basic, but the Caché ActiveX binding can be used just as easily in many other development environments.
The Caché Object Server for ActiveX
The Caché Object Server for ActiveX (CacheActiveX.dll
) is a complete ActiveX in-process automation server that gives client applications access to server-based Caché objects. Internally, the Caché Object Server for ActiveX creates an ActiveX proxy object that mirrors an object on a Caché server. Object properties are exposed as ActiveX properties. Similarly, methods are exposed as ActiveX methods. When a method of an ActiveX proxy object is called, it causes the corresponding method to be called by the mirrored Caché object on the server machine.
Every client-side ObjInstance
proxy object refers to a Caché object on a server. It is possible for several client-side objects to refer to the same server-side object. With each added reference, the server-side object's reference count is increased by one as long as any client-side objects are connected to it.
Client-side objects that perform special functions, such as the SysList
objects, are not based on a Caché object and do not refer to an object on a server. See the Caché ActiveX API Reference
for more information on the types of objects available from ActiveX.
The client-side proxy object is an ActiveX object and is referred to using a pointer to the IDispatch interface. For example, to access the properties and methods of a patient
object from Visual Basic, use the following code:
'returns the value of Name for the referenced patient object
'runs the Admit() method of the patient object on the server
As an improvement on typical ActiveX automation servers, the Caché Object Server for ActiveX does not require you to register every object class that you define with the client operating system. Instead, it determines class information at run time. This lets you develop large applications with many client machines and many server-based objects without having to maintain ActiveX registry entries.
has been the preferred version of the Caché ActiveX binding since Caché 5.1, the binding is also available through an older DLL, CacheObject.dll
. This DLL is slower and has some small differences, as noted in this documentation. You should use CacheActiveX.dll
for all new development. The older DLL is provided only for backward compatibility. The two DLLs differ primarily in the following ways:
To preserve complete compatibility with existing applications, Caché installs both CacheActiveX.dll
. By default, existing applications will continue to use the original CacheObject.dll
. If you wish to use the newer binding, you must modify your existing application to reference this new DLL, and test that your application performs as expected. To upgrade your code from CacheObject.dll
, perform the following steps: