Whatever message this page gives is out now! Go check it out!
<cfobject
class = "program ID"
name = "instance name"
action = "create|connect"
context = "inproc|local|remote"
server = "server name">
type = "com"Attribute | Req/Opt | Default | Description |
class | Required | Component ProgID for the object to invoke. When using Java stubs to connect to the COM object, the class must be the ProgID of the COM object. | |
name | Required | String; name for the instantiated component. | |
action | Optional | create |
|
context | Optional |
| |
server | Required if context = "Remote" | Server name, using Universal Naming Convention (UNC) or Domain Name Serve (DNS) convention, in one of these forms:
| |
type | Optional | Object type. The value com specifies COM objects: |
<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. Methods that expect no arguments should be called by using
empty parentheses. --->
<cfset obj.Init()>
<!--- This is a collection object. It 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>
<cfoutput>Last name: #file2.lastname# <br></cfoutput>
</cfloop>