25Writing CFX Tags with Visual C++
To install the CFX Tag Wizard, follow these steps:
1. If Visual C++ is currently running, close it.
2. Copy the cfxwiz_vc50.awx file to Visual Studio’s Template folder. For a typical Visual
Studio 6.0 installation, that folder is located at: C:\Program Files\Microsoft Visual
Studio\Common\MSDev98\Templates.
3. Copy the cfx.h file from the CFusionMX7\cfx\include folder to the Visual C++ Include
folder. For a typical Visual Studio 6.0 installation, that folder is located at: C:\Program
Files\Microsoft Visual Studio\VC98\Include.
4. Locate the CreateRegistryKey.reg file (included with this chapter’s listings) and double-
click on it. If you get a confirmation message, click OK to accept the change to the
registry. After a moment, you should receive a message saying the information was
imported successfully.
5. Start Visual C++. The ColdFusion Tag Wizard should appear if you choose File, New,
then select the Projects tab.
NOTE
A bit of explanation about that .reg file: at the time of this writing, the Tag Wizard had not been updated to reflect the fact that ColdFu-
sion no longer stores information about registered CFX tags in the Windows Registry (this information is now kept in an XML configu-
ration file within the CFusion directory tree). Therefore, a small change to the registry needs to be made before the Wizard will work
properly. The CreateRegistryKey.reg file referred to in the steps listed above simply adds a registry key (folder) called HKEY_LOCAL_
MACHINE\SOFTWARE\Allaire\ColdFusion\CurrentVersion\CustomTags, which is what the Wizard needs to work properly. If you
prefer to add the key to the registry manually using the Registry Editor that ships with Windows, go ahead. Just be careful because
making an incorrect change could seriously mess up your system!
Starting a New CFX Tag Project
Now that the ColdFusion Tag Wizard has been installed, you can use it to quickly create skeleton
code for a new CFX tag. Just follow these steps:
1. Launch Visual C++.
2. Choose File, New.... The New dialog box appears.
3. Select the Projects tab, then select the Cold Fusion Tag Wizard (Figure 30.6).
4. Enter a name for your new project in the Project name field. I recommend using the
name of the CFX tag. For this example, use
CFX_ComputeStandardDeviation as the
project name.
5. Leave the Create new workspace and Win32 options checked, as shown in Figure 30.6.
6. Click OK. The ColdFusion Tag Wizard appears (Figure 30.7).
Commenti su questo manuale