User Guide

Table Of Contents
Creating and using COM objects 957
4.
Compile your Java code. In a command prompt, do the following:
a
Make the directory that contains the Java stubs (in this example, C:\src\outlookXP) your
working directory.
b
Enter the following line:
javac -J-mx100m -J-ms100m *.java
The compiler switches ensure that you have enough memory to compile all the necessary
files.
Note: If you did not put jintegra.jar on your CLASSPATH in step 1b, add the switch
-classpath:/cf_root/lib/jintegra.jar, where cf_root is the directory where ColdFusion is
installed, to the command.
5.
Ensure that the ColdFusion server is not running. To stop the ColdFusion server, open the
Services control panel, select ColdFusion MX application server, and click Stop.
6.
Add your .class files to the ColdFusion Microsoft application Java stubs file by doing the
following:
a
In the Windows Command prompt, make the parent directory of the directory that
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.
b
Enter the following command:
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:\CFusionMX7\lib\msapps.jar outlookXP\*.class
7.
Update the cf_root /lib/neo-comobjmap.xml file by appending your object definition to the list.
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 The package name you specified in step 3c.
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
</struct> end tag:
<var name="access.application.9">
<string>coldfusion.runtime.com.com2java.access2k.Application</string>
</var>
<var name="outlook.application.10">
<string>outlookXP.Application</string>