Chapter 1: ColdFusion Tags
Example
<HTML>
<HEAD>
<TITLE>CFOBJECT (COM) Example</TITLE>
</HEAD>
<BODY>
<H3>CFOBJECT (COM) Example</H3>
<!---
Create a COM object as an inproc server (DLL).
(CLASS= prog-id)
--->
<CFOBJECT ACTION="Create"
TYPE="COM"
CLASS=Allaire.DocEx1.1
NAME="obj">
<!---
Call a method.
Note that methods that expect no arguments should
be called using empty parenthesis.
--->
<CFSET obj.Init()>
<!---
This object is a collection object, and should
support at a minimum:
Property : Count
Method : Item(inarg, outarg)
and a special property called _NewEnum
--->
<CFOUTPUT>
This object has #obj.Count# items.
<BR>
<HR>
</CFOUTPUT>
<!---
Get the 3rd object in the collection.
--->
<CFSET emp = obj.Item(3)>
<CFOUTPUT>
The last name in the third item is #emp.lastname#.
<BR>
<HR>
</CFOUTPUT>
<!---
Loop over all the objects in the collection.
--->
<P>Looping through all items in the collection:
<BR>
<CFLOOP COLLECTION=#obj# ITEM=file2>
145
Need help?
Do you have a question about the COLDFUSION 4.5-CFML LANGUAGE and is the answer not in the manual?
Questions and answers