As of ColdFusion (2021 release), CORBA has been removed. You can no longer use CORBA-related features, functions, and tags.
The CreateObject function can create an instance of a ColdFusion component (CFC) object.
A component object.
CreateObject(type, component-name, domain, username, password)
History
ColdFusion (2016 release) Update 3: Added the parameters domain, username, and password.
Note: The new parameters are applicable only when type="COM".
Building and Using ColdFusion Components in the Developing ColdFusion Applications
Parameter |
Description |
|---|---|
type |
(Optional) - Type of object to create. The default value of type is component .
|
component-name |
The CFC name; corresponds to the name of the file that defines the component; for example, use engineComp to specify the component defined in the engineComp. cfc file |
domain |
The domain to which the user belongs. |
username |
The user name to access the COM component. |
password |
The password of the above user name . |
On UNIX systems, ColdFusion searches first for a file with a name that matches the specified component name, but is all lowercase. If it does not find the file, it looks for a filename that matches the component name exactly, with the identical character casing.In the following example, the CFScript statements assign the tellTimeCFC variable to the tellTime component using the CreateObject function. The CreateObject function references the component in another directory. To invoke component methods, you use function syntax.
<b>Server's Local Time:</b>
<cfscript>
tellTimeCFC=CreateObject("component","appResources.components.
tellTime");
tellTimeCFC.getLocalTime();
</cfscript>
<br>
<b>Calculated UTC Time:</b>
<cfscript>
tellTimeCFC.getUTCTime();
</cfscript>
Sign in to your account