Name

CreateObject

Synopsis

                  
                  
                  CreateObject("COM", class, context, server)
CreateObject("CORBA", class, context, [locale])
CreateObject("Java", class)
CreateObject("Component", component_name)
CreateObject("Webservice", wsdl_url)

Allows ColdFusion to call different kinds of objects from within cfscript blocks. This function has the same functionality as the cfobject tag.

When the first argument is "COM", the function supports instantiating and using COM objects on local and remote machines. COM objects aren’t currently supported for Unix versions of ColdFusion. In this case, class specifies the program ID for the object, and context specifies the context the object is running in (InProc, Local, or Remote). server is required when context is Remote; it specifies a valid server name using Universal Naming Convention (UNC) or Domain Name Server (DNS) conventions. Example:

<cfscript>
  MyWord = CreateObject("COM","Word.Application","Local");
</cfscript>

When the first argument is "CORBA", the function supports calling methods in CORBA objects from within cfscript blocks. In this case, context specifies the context for accessing the CORBA object (IOR or NameService). If context is IOR, class specifies the name of a file that contains the stringified version of the Interoperable Object Reference (IOR). If context is NameService, class specifies a period-delimited naming context for the naming service. locale specifies type/value pairs of arguments (which must begin with a minus sign) to pass ...

Get Programming ColdFusion MX, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.