User Guide
276 Developing Web Applications with ColdFusion
What Are CFX Tags?
CFX tags are custom tags written against the ColdFusion Application Programming
Interface. Generally, you create a CFX if you want to do something that’s not possible
in CFML, or if you want to improve performance of a task in CFML that’s repetitive.
Unlike CFML custom tags, CFXs are implemented as DLL files and can:
• Handle any number of custom attributes.
• Use and manipulate ColdFusion queries for custom formatting.
• Generate ColdFusion queries for interfacing with non-ODBC based
information sources.
• Dynamically generate HTML to be returned to the client.
• Set variables within the ColdFusion application page from which they are
called.
• Throw exceptions that result in standard ColdFusion error messages.
You can build CFXs using C++ or Java. Then, to be able to use the CFX, you have to
register it in the ColdFusion Administrator.
Before You Begin Developing CFX Tags in C++
Sample C++ CFXs
Before you begin development of a CFX tag in C++, you may want to study the two CFX
tags that are included to give you additional insight into working with the CFAPI. The
two example tags are:
•
CFFX_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
Solaris, look in /<
installdirectory
>/coldfusion/cfx/examples.
Setting Up Your C++ Development Environment
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\cfx\include) to your list of global include
paths. On UNIX, you will need
-I <
includepath
> on your compile line (see the
Makefile directory list example).