MACROMEDIA COLDFUSION MX 61-DEVELOPING COLDFUSION MX Develop Manual page 773

Developing coldfusion mx applications
Table of Contents

Advertisement

Ensure that the ColdFusion server is not running. To stop the ColdFusion server, open the
5
Services control panel, select ColdFusion MX application server, and click Stop. (In Windows
98 or Windows ME, select Stop ColdFusion MX from the ColdFusion MX Programs item on
the Start menu.)
Add your .class files to the ColdFusion Microsoft application Java stubs file by doing the
6
following:
In the Windows Command prompt, make the parent directory of the directory that
a
contains your class files your working directory. In this example, make c:\src your working
director by entering cd .. in the Command prompt from step 4.
Enter the following command:
b
jar -uvf cf_root\lib\msapps.jar directoryName\*.class
Where cf_root is the directory where ColdFusion MX is installed and directoryName is the
name of the directory that contains the class files. For the OutlookXP example, enter the
following line:
jar -uvf C:\CFusionMX\lib\msapps.jar outlookXP\*.class
Update the cf_root /lib/neo-comobjmap.xml file by appending your object definition to the list.
7
The object definition consists of the following lines:
<var name="progID">
<string>PackageName.mainClass</string>
</var>
Use the following values in these lines:
ProgID
The COM object's ProgID, as displayed in the OLE/COM object viewer.
PackageName
mainClass
The main class of the COM object. The main class contains the methods you
invoke. For many Microsoft applications, this class is Application. In general, the largest
class file created in step 4 is the main class.
For example, to add outlookXP to neo-comobjmap.xml, add the lines in bold text above the
end tag:
</struct>
<var name="access.application.9">
<string>coldfusion.runtime.com.com2java.access2k.Application</string>
</var>
<var name="outlook.application.10">
<string>outlookXP.Application</string>
</var>
</struct>
In this example, outlook.application.10 is the ProgID of the Outlook COM object, outlookXP
is the package name you specified in step 3c, and Application is the COM object's main class.
Restart the ColdFusion server: Open the Services control panel, select ColdFusion MX
8
application server, and click the Start button.
After you have installed the stubs, you can delete the directory you created in step 2, including
9
all its contents.
The package name you specified in step 3c.
Creating and using COM objects
773

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion mx

Table of Contents