ColdFusion 9.0 Resources |
Getting started with COM and DCOMColdFusion 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 type information to correctly set up the arguments on call invocations. Any ambiguity in the object data types can lead to unexpected behavior. In ColdFusion, 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 could appear on the web server desktop, not on the client desktop. This behavior 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. COM requirementsTo use COM components in your ColdFusion application, you need at least the following items:
Registering the objectAfter you acquire an object, register it with Windows for ColdFusion (or any other program) to find it. Some objects have setup programs that register objects automatically, while others require manual registration. You can register Inproc object servers (.dll or .ocx files) manually by running the regsvr32.exe utility using the following form: regsvr32 c:\path\servername.dll You typically register Local servers (.exe files) either by starting them or by specifying a command-line parameter, such as the following: C:\pathname\servername.exe -register Finding the component ProgID and methodsYour 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 interfacesEffective with ColdFusion, the ColdFusion cfdump tag displays the following information about a COM object:
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 ViewerThe 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. 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:
|