Chapter 18: Building Custom CFAPI Tags
277
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
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.
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
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 289
.
Compiling C++ CFXs
CFX tags built on Windows NT and UNIX must be thread safe. CFXs for Solaris should
be compiled with the
-mt
switch on the Sun compiler.
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
) and set the program arguments setting to
-DEBUG
.
Summary of Contents for COLDFUSION 4.5-DEVELOPING WEB
Page 1: ...Allaire Corporation Developing Web Applications with ColdFusion ColdFusion 4 5...
Page 14: ...xiv Developing Web Applications with ColdFusion...
Page 26: ...xxvi Developing Web Applications with ColdFusion...
Page 34: ...8 Developing Web Applications with ColdFusion...
Page 70: ...44 Developing Web Applications with ColdFusion...
Page 84: ...58 Developing Web Applications with ColdFusion...
Page 114: ...88 Developing Web Applications with ColdFusion...
Page 148: ...122 Developing Web Applications with ColdFusion...
Page 174: ...148 Developing Web Applications with ColdFusion...
Page 208: ...182 Developing Web Applications with ColdFusion...
Page 244: ...218 Developing Web Applications with ColdFusion...
Page 274: ...248 Developing Web Applications with ColdFusion...
Page 288: ...262 Developing Web Applications with ColdFusion...
Page 300: ...274 Developing Web Applications with ColdFusion...
Page 350: ...324 Developing Web Applications with ColdFusion...
Page 362: ...336 Developing Web Applications with ColdFusion...