User Guide

402 Chapter 21 Building Custom CFXAPI Tags
To build a CFX tag:
1 In Visual C++, select File > New, and then click the Projects tab.
2 Select ColdFusion Tag Wizard and enter a tag name of the form
CFX_MyNewTag in
the Project name box. Click OK to open the wizard.
3 Enter the new tag name as the name of the custom tag.
4 (Optional) Add text that will appear as comments in the tags code.
5 Select an MFC usage option and click Finish to generate the code.
6 In Visual C++, select Build > Build CFX_MyNewTag to create the DLL file.
The next step is to make ColdFusion aware of the new tag by registering it. See
Registering CFXs on page 404.
Compiling C++ CFXs
CFX tags built on Windows NT and UNIX must be thread safe. Compile CFXs for
Solaris with the
-mt switch on the Sun compiler.
Implementing C++ CFX tags
CFX tags built in C++ use the tag request object, represented by the C++ class
CCFXRequest. This object represents a request made from an application page to a
custom tag. A pointer to an instance of a request object is passed to the main
procedure of a custom tag. The methods available from the request object allow the
custom tag to accomplish its work. For a detailed description of the CFXAPI classes
and members, see the see CFML Reference.
Debugging C++ CFXs
After you configure a debug session, you can run your custom tag from within the
debugger, set breakpoints, single-step, and so on.
On Windows NT
You can easily debug custom tags within the Visual C++ environment. To debug a
tag, open the Build Settings dialog box and click the Debug tab. Set the Executable
for debug session setting to the full path to the ColdFusion Engine (such as,
c:\cfusion\bin\cfserver.exe) and set the program arguments setting to
-DEBUG.