328
Developing Web Applications with ColdFusion
Calling nested objects
The current release of ColdFusion does not support nested (scoped) object calls. For
example, if an object method returns another object and you would like to invoke a
property/method on that object, the following is required:
<CFSET objX = myObj.X>
<CFSET prop = objX.Property>
(That is, the syntax
<CFSET prop = myObj.X.Property>
will fail.)
Getting Started with COM/DCOM
ColdFusion is an automation (late-binding) COM client. This implies that the COM
object has to support the IDispacth interface, and that arguments for methods and
properties be standard automation types. Since ColdFusion is a typeless language, it
uses the object’s type information to correctly set up the arguments on call
invocations. Any ambiguity in the object’s data-types could lead to unexpected
behavior.
It is important to use server-side COM objects in ColdFusion, that is, they should not
have a graphical user interface. If you invoke an object with a graphical interface in
your ColdFusion application, a window for the component might appear on the Web
server desktop, not on the user’s desktop. This could tie up ColdFusion server threads
and result in further Web server requests not being serviced.
ColdFusion can call Inproc, Local, or remote COM objects. The attributes specified in
the CFOBJECT tag determine which type of object is called.
Requirements for COM
To make use of COM components in your ColdFusion application, you need at least
the following items:
•
The Microsoft OLE/COM Object Viewer, available from Microsoft. It is a handy
tool for viewing registered COM objects.
•
The COM objects you want to use in your ColdFusion application pages. These
are typically DLL or EXE files. These components should allow late binding,
that is, they implement the IDispatch interface. Object Viewer allows you to
view the object’s class information so that you can properly define the CLASS
attribute for the CFOBJECT tag. It also displays the object’s supported
interfaces, which allows you to discover the properties and methods (for the
IDispatch interface) of the object.
Registering the object
Once you’ve acquired the object you want to use, you may need to register it with
Windows in order for ColdFusion (or anything else) to find it. Some objects may be
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...