Chapter 18: Building Custom CFAPI Tags
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, the CFXAPI Tag Development Kit must be installed (it is 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.
To build a CFX tag:
1.
In Visual C++, select File > New, then click the Projects tab.
2.
Select ColdFusion Tag Wizard and enter a tag name of the form
the Project name box. Click OK to open the wizard.
3.
Enter the new tag name as the name of the custom tag.
4.
You can optionally add text that will appear as comments in the tag's code.
5.
Select an MFC usage option and click Finish to generate the code.
6.
In Visual C++, select Build > Build
The next step is to make ColdFusion aware of the new tag by registering it. See
"Registering CFXs" on page
Compiling C++ CFXs
CFX tags built on Windows NT and UNIX must be thread safe. CFXs for Solaris should
be compiled with the
Debugging C++ CFXs
Once a debug session is configured, you can run your custom tag from within the
debugger, set breakpoints, single-step, and so on.
On Windows NT
Custom tags can easily be debugged within the Visual C++ environment. To debug a
tag, open the Build Settings dialog 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
CFX_MyNewTag
289.
switch on the Sun compiler.
-mt
) and set the program arguments setting to
CFX_MyNewTag
to create the DLL file.
-DEBUG
277
in
.
Need help?
Do you have a question about the COLDFUSION 4.5-DEVELOPING WEB and is the answer not in the manual?