User Guide

Table Of Contents
948 Chapter 38: Integrating COM and CORBA Objects in CFML Applications
Use the following techniques to call methods:
If the method has no arguments, follow the method name with empty parentheses, as in the
following
cfset tag:
<cfset retVal = obj.Method1()>
If the method has one or more arguments, put the arguments in parentheses, separated by
commas, as in the following example, which has one integer argument and one string
argument:
<cfset x = 23>
<cfset retVal = obj.Method1(x, "a string literal")>
If the method has reference (Out or In,Out) arguments, use double quotation marks (")
around the name of the variable you are using for these arguments, as shown for the variable x
in the following example:
<cfset x = 23>
<cfset retVal = obj.Method2("x", "a string literal")>
<cfoutput> #x#</cfoutput>
In this example, if the object changes the value of x, it now contains a value other than 23.
Calling nested objects
ColdFusion supports nested (scoped) object calls. For example, if an object method returns
another object, and you must invoke a property or method on that object, you can use the syntax
in either of the following examples:
<cfset prop = myObj.X.Property>
or
<cfset objX = myObj.X>
<cfset prop = objX.Property>
Getting started with COM and DCOM
ColdFusion is an automation (late-binding) COM client. As a result, the COM object must
support the IDispatch interface, and arguments for methods and properties must be standard
automation types. Because 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 can
lead to unexpected behavior.
In ColdFusion, you should only use server-side COM objects, which do not have a graphical user
interface. If your ColdFusion application invokes an object with a graphical interface in a
window, the component might appear on the web server desktop, not on the user's desktop. This
can take up ColdFusion server threads and prevent further web server requests from 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.