User Guide
Developing CFX Tags in C++ 401
Developing CFX Tags in C++
The following sections provide some background to help you develop CFX tags in
C++.
Sample C++ CFXs
Before you begin development of a CFX tag in C++, you might want to study the two
CFX tags that are included to give you additional insight into working with the
CFXAPI. The two example tags are as follows:
•
CFX_DIRECTORYLIST Queries a directory for the list of files it contains.
• CFX_NTUSERDB (Windows NT only) Allows addition and deletion of NT users.
On Windows NT, these tags are located in the \cfusion\cfx\examples directory. On
UNIX, look in /<installdirectory>/coldfusion/cfx/examples.
Setting up your C++ development environment
The following compliers generate valid CFX code for UNIX platforms:
Before you can use your C++ compiler to build custom tags, you must enable the
compiler to locate the CFXAPI header file,
cfx.h. On Windows NT, you do this by
adding the CFXAPI Include directory to your list of global include paths. On
Windows, this directory is \cfusion\cfx\include. On UNIX it is /opt/coldfusion/cfx/
include. On UNIX, you will need
-I <includepath> on your compile line (see the
Makefile for the directory list example in the cfx/examples directory).
Using the Tag Wizard to create CFXs in C++
On Windows NT, you can get a start in developing CFXs by using the ColdFusion Tag
Wizard. To use the wizard, you must install the CFXAPI Tag Development Kit (it is
installed by default), and the setup routine must detect Microsoft Visual C++ on the
system.
The wizard generates a DLL file with a basic tag structure containing a single
procedure. By modifying and testing this tag, you can quickly learn how to work
within the API.
Platform Compiler
Solaris Sun C++ compiler 5.0 or higher (gcc does not work)
Linux RedHat 6.2 gcc/egcs 1.1.2 compiler
HPUX 11 HP aCC C++ compiler