Another technology supported for extending ColdFusion is C++. ColdFusion exposes a C++ based API you can employ for encapsulating specific features in a ColdFusion tag, generally known as a CFX tag. The ColdFusion Application Programming Interface (CFAPI) is a C++ based API for creating C++ based tags for use in ColdFusion. These custom tags implemented as DLLs and have the following capabilities:
- The ability to handle any number of custom attributes.
- The ability to use and manipulate ColdFusion queries for custom formatting.
- The ability to generate ColdFusion queries for interfacing with non-ODBC based information sources.
- The ability to dynamically generate HTML to be returned to the client.
- The ability to set variables within the ColdFusion application page from which they are called.
- The ability to throw exceptions which result in standard ColdFusion error messages.
On Windows NT, you can get started quickly by using the ColdFusion Custom Tag Visual C++ AppWizard to generate a tag. The custom tag wizard is automatically installed during setup if Visual C++ 4.0 or higher is present on your system. By modifying the default tag implementation and experimenting, you will quickly learn how to use the API.
Before you can use your C++ compiler to build custom tags, you must enable the compiler to locate the CFAPI header file, cfx.h . On Windows NT, you do this by adding the CFAPI Include directory (\cfusion\cfapi\include ) to your list of global include paths. On Solaris, you will need -I < includepath> on your compile line (see the Makefile directory list example).
|