22.08.2013 Views

ColdFusion Developer's Guide

ColdFusion Developer's Guide

ColdFusion Developer's Guide

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta<br />

a. In the Windows Command prompt, make the parent directory of the directory that<br />

contains your class files your working directory. In this example, make c:\src your<br />

working director by entering cd .. in the Command prompt from step 4.<br />

b. Enter the following command:<br />

jar -uvf cf_root\lib\msapps.jar directoryName\*.class<br />

Where cf_root is the directory where <strong>ColdFusion</strong> is installed and directoryName is the<br />

name of the directory that contains the class files. For the OutlookXP example, enter<br />

the following line:<br />

jar -uvf C:\CFusion\lib\msapps.jar outlookXP\*.class<br />

7. Update the cf_root /lib/neo-comobjmap.xml file by appending your object definition to the<br />

list. The object definition consists of the following lines:<br />

<br />

PackageName.mainClass<br />

<br />

Use the following values in these lines:<br />

ProgID The COM object’s ProgID, as displayed in the OLE/COM object viewer.<br />

PackageName The package name you specified in step 3c.<br />

mainClass The main class of the COM object. The main class contains the methods<br />

you invoke. For many Microsoft applications, this class is Application. In general, the<br />

largest class file created in step 4. is the main class.<br />

For example, to add outlookXP to neo-comobjmap.xml, add the lines in bold text above<br />

the<br />

end tag:<br />

<br />

coldfusion.runtime.com.com2java.access2k.Application<br />

<br />

<br />

outlookXP.Application<br />

<br />

<br />

In this example, outlook.application.10 is the ProgID of the Outlook COM object,<br />

outlookXP is the package name you specified in step 3c, and Application is the COM<br />

object’s main class.<br />

8. Restart the <strong>ColdFusion</strong> server: Open the Services control panel, select <strong>ColdFusion</strong><br />

application server, and click the Start button.<br />

9. After you have installed the stubs, you can delete the directory you created in step 2.,<br />

including all its contents.<br />

Creating and using COM objects 1399

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!