35Writing CFX Tags with Visual C++
5. Leave the Procedure field set to ProcessTagRequest unless you changed the name of the
ProcessTagRequest() function produced by the ColdFusion Tag Wizard when you
created your project’s workspace.
6. Leave the Keep Library Loaded unless your DLL will occupy a large amount of space in
the server’s memory and will be used infrequently. Another reason to uncheck this box is
if your DLL is not thread safe. See the “Using CFX Tags Safely: Locking and Thread
Safety” section later in this chapter for details.
7. If you wish, fill in the optional Description field.
8. Press OK to register the tag. It will now appear in the list of registered tags in the CFX
Tags page, and is ready for use in your ColdFusion pages.
Using the New Tag
Listing 30.7 shows how the new <CFX_ComputeStandardDeviation> tag can be used in a ColdFusion
page. First, data from the Films table is retrieved using an ordinary
SELECT query. Then the CFX
tag is called, specifying the RatingID column of the query as the column for which to compute the
standard deviation. After the tag executes, the computed standard deviation will be available to
ColdFusion in the
FilmsStdDev variable. Similar steps are used to compute the standard deviation of
the prices in the Merchandise table.
Listing 30.7 ComputeStandardDeviationDemo.cfm—Computing the Standard Deviation
<!---
Filename: ComputeStandardDeviationDemo.cfm
Author: Nate Weiss (NMW)
Purpose: Computes standard deviations
Figure 30.9
Like Java CFX tags,
tags written in C++
need to be registered
in the ColdFusion
Administrator.
Commentaires sur ces manuels