Using Caché Direct
Using Caché Direct in Non-ActiveX Applications
[Back] [Next]
   
Server:docs1
Instance:LATEST
User:UnknownUser
 
-
Go to:
Search:    

This chapter describes how to use Caché Direct properties and methods from an application such as C++ that does not use ActiveX (where you do not have VisM.ocx). It assumes you have a good understanding of programming in other languages.

General Procedure
The overall procedure is as follows:
  1. Get the Caché Direct header files (.h) from the InterSystems InterSystems Worldwide Response Center (WRC). These files define the C++ classes that provide Caché Direct capabilities.
  2. Include these files in your application source code.
  3. To reproduce the functionality of the VisM object, have your code create an instance of the CDLink class and an instance of the CDParms class. In general:
  4. Set values of properties and execute methods as needed. The same rules and considerations apply in this case as with the VisM control.
Recommendations
The header files provide a lot of information about the Caché Direct classes, but not all these classes are suitable for direct use. The first recommendation is to use only the CDLink and CDParms classes. These classes expose the appropriate methods of the lower-level classes and ensure that connections are managed correctly. You should ignore classes other than CDLink and CDParms.
The second recommendation is to use the CtrlExec1() method of CDLink, rather than the CtrlExec() method. The former method is designed for use with the CDParms class, which you use as a container for the mirrored properties.
Notes
For reference purposes only, you may find it helpful to understand the organization of the Caché Direct classes. First, the primary classes are as follows:
To support direct access, there are also some helper classes:
Each CDProp contains a single property. CDParms is a collection of all the CDProps for one client.