Developing CFX Tags in C++The following sections provide some background to help you develop CFX tags in C++. Sample C++ CFXsBefore 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:
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 environmentThe 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, 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. To build a CFX tag:
The next step is to make ColdFusion aware of the new tag by registering it. See "Registering CFXs". Compiling C++ CFXs
CFX tags built on Windows NT and UNIX must be thread safe. Compile CFXs for Solaris with the Implementing C++ CFX tags
CFX tags built in C++ use the tag request object, represented by the C++ class Debugging C++ CFXsAfter 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 On UNIXUse the following debuggers and settings for the supported UNIX operating systems:
Shut down ColdFusion using the stop script. Set the environment variables as they are set in the start script. You can then run the cfserver executable under the dbx debugger and set breakpoints in your CFX code. You might need to set a breakpoint in
|