MACROMEDIA COLDFUSION 4.5-CFML LANGUAGE Manual do Utilizador Página 34

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 44
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 33
34 CHAPTER 30 Extending ColdFusion with CFX
NOTE
The atof() function returns 0 if it encounters a string that can’t be parsed into a number. It doesn’t generate an error. This means
that this CFX tag will treat anything other than a number as a 0, which will affect the tag’s computations. In other words, the tag is
smart enough to skip over null values, but it is not smart enough to skip over other non-numeric data points. This should not be a
problem because a column would not typically include both numbers and strings.
Compiling Your New CFX Tag
To compile the tag, simply choose the Build option from the Build menu in Visual C++, or use the
Build toolbar button. Assuming there are no syntax or other problems with the code, the compiler
should be able to compile the tag in a few seconds. The result will be a Dynamic Link Library (.dll)
file, located in either the project\Debug or project\Release subfolder of Visual Studio’s My Projects
folder (where the project part is most likely the name of your CFX tag).
It’s worth noting that you will be building a Debug version of the DLL by default. I recommend
switching to the Win32 Release configuration before compiling the tag. You may use the default
Win32 Debug configuration if you wish during testing, but you will probably be doing most of your
debugging via
pRequest->WriteDebug() rather than conventional debugging methods, so the Win32
Debug build is unlikely to do you much good in terms of actual debugging. To switch to the Win32
Release configuration, choose Build, Set Active Configuration from the Visual C++ menu.
NOTE
Either type of build should perform the same way in your ColdFusion pages, but the debug version will be larger and cannot be
deployed to ColdFusion servers that don’t contain Microsoft’s debugging symbols. In general, the debugging symbols are only
installed on machines that have Visual C++ installed on them, which means that debug builds of CFX tags will probably only work on
the ColdFusion server installed on your local machine (if any).
Registering the New Tag
Once the tag has been compiled, you need to register it in the ColdFusion Administrator. The reg-
istration process is simple and very similar to the process for Java CFX tags. Just follow these steps:
1. Open the ColdFusion Administrator and navigate to the CFX Tags page.
2.
Click the Register C++ CFX button. The Add/Edit C++ CFX Tag page appears (Figure 30.9).
3. In the Tag Name field, enter the name of the tag, including the CFX_ part. This does not
have to be the same as the tag name you used while creating the C++ code, but I
recommend that you keep them consistent to keep from getting confused. The tag name
is not case sensitive.
4. In the Server Library field, provide the location of the .dll file that represents the compiled
version of your CFX tag. If you are registering the tag on a ColdFusion server installed
on the same machine that you compiled the tag on, you can just specify the DLLs current
location within Visual Studio’s directory tree. That way, whenever you rebuild the tag,
the server will automatically be looking at the newly built version. If the server is not on
your local development machine, you will need to copy the DLL to the server’s local
drive first (you can place the DLL in whatever location you wish).
Vista de página 33
1 2 ... 29 30 31 32 33 34 35 36 37 38 39 ... 43 44

Comentários a estes Manuais

Sem comentários