
1174
DEVELOPING
COLDFUSION 9 APPLICATIONS
Using Web Elements and External Objects
Las
t
upda
te
d 8/5/2010
Finding the component ProgID and methods
Your COM object supplier provides documentation that explains each of the component methods and the ProgID. If
you do not have documentation, use either the ColdFusion
cfdump
tag or the OLE/COM Object Viewer to view the
component interface.
Using the cfdump tag to view COM object interfaces
Effective with ColdFusion, the ColdFusion
cfdump
tag displays the following information about a COM object:
•
Public methods
•
Put properties
•
Get properties
The method and property information include the parameter or property types and whether they are in, out, optional,
or retval values. The
cfdump
tag output does not include the ProgID of the object.
Note:
The dump header indicates the ColdFusion object class, which is coldfusion.runtime.com.ComProxy, and the COM
object CLSID.
Using the OLE/COM Object Viewer
The OLE/COM Object Viewer installation installs the executable, by default, as \mstools\bin\oleview.exe. You use the
Object Viewer to retrieve a COM object ProgID, as well as its methods and properties.
To find an object in the Object Viewer, it must be registered, as described in “
Registering the object
” on page 1173. The
Object Viewer retrieves all COM objects and controls from the Registry, and presents the information in a simple
format, sorted into groups for easy viewing.
By selecting the category and then the component, you can see the ProgID of a COM object. The Object Viewer also
provides access to options for the operation of the object.
To view object properties:
1
Open the Object Viewer and scroll to the object that you want to examine.
2
Select and expand the object in the left pane of the Object Viewer.
3
Right-click the object to view it, including the TypeInfo.
If you view the TypeInfo, you see the object methods and properties. Some objects do not have access to the
TypeInfo area, which is determined when an object is built and by the language used.
Creating and using COM objects
Use the
cfobject
tag or the
CreateObject
function to create an instance of the COM object (component) in
ColdFusion before your application pages can invoke any methods or assign any properties in the component.
For example, the following code uses the
cfobject
tag to create the Windows CDO (Collaborative Data Objects) for
NTS NewMail object to send mail:
<cfobject type="COM"
action="Create"
name="Mailer"
class="CDONTS.NewMail">
The following line shows how to use the corresponding
CreateObject
function in CFScript:
Mailer = CreateObject("COM", "CDONTS.NewMail");