3.12 Using Delphi .exe

IMPORTANT: Use these procedures only if you chose not to have the wizard create a Delphi project file (.DPR). That is, you answered No in Step 4 of Completing the C3PO.

(If you answered Yes, click here for Using Delphi .dll.)

These procedures assume you chose not to create a Delphi project file (.DPR) because you want to create an .EXE file for your C3PO.

This guide consists of the following sections:

3.12.1 New Files

  • XXXC3PO.PAS

  • XXXREADME.TXT

  • XXXSERV.PAS

  • XXX.WIZ

3.12.2 Creating an .EXE File

Now that you have created a C3PO for Delphi, you need to perform the following steps to make your C3PO work for you. Unless otherwise specified, all files you create using these procedures should be placed in the same directory as the new C3PO files listed above.

  1. Copy the C3POINC.PAS file (downloaded with the wizard) to the same directory as your new C3PO files.

    • You should now have three .PAS files: XXXC3PO.PAS, XXXSERV.PAS, and C3POINC.PAS.

  2. Start a new Application project (File New).

  3. Save the project (File Save All).

  4. Build the project (Project Build).

    • If your C3PO does not use constants, a build error may occur. If this happens, note which CONST statement is causing the error, comment it out, then rebuild.

3.12.3 Registering Your C3PO

  1. Switch to your Windows desktop.

  2. Register the C3PO with GroupWise and Windows by running the C3PO from Windows (Start Run) using the syntax: XXXC3PO.EXE /R, where XXXC3PO represents the unique name of your C3PO. The C3PO code will then execute and insert the proper information into the Windows Registry.

    (See Registering Your C3PO for information on unregistering a C3PO.)

3.12.4 Testing Your C3PO

  1. Switch to your Windows desktop.

  2. Insert breakpoints in your C3PO procedures. This will ensure that the appropriate procedures are called and that your C3PO is being implemented correctly.

  3. Run your C3PO. (The C3PO will not execute because GroupWise has not yet been started.)

  4. Start GroupWise.

    • Depending on which events or menu items your C3PO is programmed to handle, your application should stop at your breakpoints or immediately after you cause your events to occur in GroupWise.

3.12.5 Unregistering Your C3PO

Should you ever need to unregister your C3PO, follow these steps:

  1. Switch to your Windows desktop.

  2. Unregister the C3PO from GroupWise and Windows by running the C3PO from Windows (Start Run) using the syntax: XXXC3PO.EXE /U, where XXXC3PO represents the unique name of your C3PO. The C3PO code will then execute and remove the registry information for this C3PO from the Windows registry.

3.12.6 Sample C3PO

The GroupWise SDK includes a sample C3PO named C3POBYWIZ.WIZ that you can copy and use as you wish. This sample is located in the following directory:

Novell/Ndk/GroupWise/Gw_5/C3po/Tools/C3poWizard/Delphi/Samples/

The C3POBYWIZ.WIZ sample:

  • Handles Ready and Shutdown events

  • Creates a new menu item under the File/New menu

  • Creates a new context menu item

  • Creates a custom class

  • Handles the Open command of that custom class