| Updated: 21 January 1999 |
OpenVMS Connectivity Developer Guide
| Previous | Contents | Index |
The OpenVMS MIDL compiler is identical to the Microsoft Interface Definition Language (MIDL) compiler on Windows NT 4.0 SP3 except for the following:
This chapter provides a list of the contents of the COM for OpenVMS kit,
a list of prerequsite software, and a preinstallation requirements. It
also describes how to install COM for OpenVMS, and includes
postinstallation instructions.
4.1 Contents of the COM Version 1.0 for OpenVMS Kit
COM Version 1.0 for OpenVMS is an unauthenticated implementation---that is, COM Version 1.0 for OpenVMS makes no security checks to authenticate or validate client requests within a server. Do not use COM Version 1.0 for OpenVMS in an environment that requires secure COM. COM Version 1.1 for OpenVMS will implement NTLM authentication and will authenticate requests between a COM client and a COM server. For more information about COM for OpenVMS security, see Section 1.1.11.
The COM Version 1.0 for OpenVMS contains the following:
The following software is required:
Before you install COM for OpenVMS, you must configure and start TCP/IP services.
The following sections describe how to configure and start OpenVMS UCX and DIGITAL TCP/IP Services for OpenVMS.
If your system is running DIGITAL TCP/IP Services for OpenVMS, you need to read Section 4.3.1 and Section 4.3.2 only.
If your system is running OpenVMS UCX, you need to read Section 4.3.3
and Section 4.3.4 only.
4.3.1 Configuring DIGITAL TCP/IP Services for OpenVMS
If your OpenVMS system is running OpenVMS Version 7.2 and DIGITAL TCP/IP Services for OpenVMS
Version 5.0, you do not need to configure DIGITAL TCP/IP Services for OpenVMS to work with
OpenVMS DCE/RPC. The system automatically checks and adjusts the
parameters as necessary.
4.3.2 Starting DIGITAL TCP/IP Services for OpenVMS
Use the following command to start DIGITAL TCP/IP Services for OpenVMS:
$ @SYS$STARTUP:TCPIP$STARTUP |
If your OpenVMS system is running OpenVMS Version 7.2 and OpenVMS UCX Version 4.1-12 or higher, you must configure UCX values for OpenVMS DCE/RPC. When OpenVMS DCE/RPC starts, it checks that it has the required UCX parameters. If the values are correct, OpenVMS DCE/RPC starts. If the values are not correct, OpenVMS DCE/RPC displays the command needed to fix the problem, and asks whether you want to continue OpenVMS DCE/RPC startup.
The UCX commands to set the required OpenVMS DCE/RPC parameters are as follows:
$ UCX SET PROTOCOL TCP /NODELAY $ UCX SET CONFIGURATION PROTOCOL TCP /NODELAY $ UCX SET PROTOCOL TCP /NOLOOPBACK $ UCX SET CONFIGURATION PROTOCOL TCP /NOLOOPBACK $ UCX SET COMMUNICATION/LARGE=(MAXIMUM:200) $ UCX SET CONFIGURATION COMMUNICATION/LARGE=(MAXIMUM:200) $ UCX SET COMMUNICATION/SMALL=(MAXIMUM:600) $ UCX SET CONFIGURATION COMMUNICATION/SMALL=(MAXIMUM:600) $ UCX SET COMMUNICATION /DEVICE_SOCKETS=250 $ UCX SET CONFIGURATION COMMUNICATION/DEVICE_SOCKETS=250 |
Use the following command to start OpenVMS UCX Version 4.1-12 or higher:
$ @SYS$STARTUP:UCX$STARTUP |
The COM for OpenVMS installation kit contains a single POLYCENTER Software Installation file. The name of the kit is DEC-AXPVMS-DCOM-V0100--1.PCSI. You must install the COM for OpenVMS files on an OpenVMS Alpha Version 7.2 system.
To install COM for OpenVMS, invoke the POLYCENTER Software Installation utility using the following command:
$ PRODUCT INSTALL /SOURCE=device:[user] DCOM |
For device:[user], specify the device name and directory location of the kit.
The COM for OpenVMS MIDL compiler requires a license. Compaq provides the DCOM-MIDL PAK separately from the COM for OpenVMS kit. |
Example 4-1 shows a sample installation.
| Example 4-1 Sample COM for OpenVMS Installation |
|---|
$ PRODUCT INSTALL /SOURCE=device:[user] DCOM
The following product has been selected:
DEC AXPVMS DCOM V1.0 Layered Product
Do you want to continue? [YES]
Configuration phase starting ...
You will be asked to choose options, if any, for each selected product and for
any products that may be installed to satisfy software dependency requirements.
DEC AXPVMS DCOM V1.0
Copyright © Compaq Computer Corporation 1998. All rights reserved.
Do you want the defaults for all options? [YES]
The following requirements must be met prior to installing OpenVMS DCOM
- You must be running OpenVMS Alpha V7.2 or later
- You must be running UCX V4.1-12 ECO2 or later
- You must be running OpenVMS DCE RPC
- In order to use the DCOM MIDL compiler you must install
the DCOM-MIDL License PAK
Do you want to continue? [YES]
Do you want to review the options? [NO]
Execution phase starting ...
The following product will be installed to destination:
DEC AXPVMS DCOM V1.0 DISK$COSMOS_SYS:[VMS$COMMON.]
Portion done: 0%...10%...20%...30%...40%...50%...60%...80%...90%...100%
The following product has been installed:
DEC AXPVMS DCOM V1.0 Layered Product
$
|
Compaq recommends that you modify the SYS$MANAGER:SYLOGICALS.COM command file to control COM for OpenVMS startup.
OpenVMS Version 7.2 includes a revised SYLOGICALS.TEMPLATE file that includes new startup commands for COM for OpenVMS and related components. Review the "Coordinated Startup" section of this template file and add the appropriate information to your existing startup files.
To have COM for OpenVMS start automatically when the system boots, copy the following line to your SYLOGICALS.COM file, uncomment the line, and make sure it is set to TRUE:
$ DEFINE/SYSTEM DCOM$TO_BE_STARTED TRUE |
If you do not set COM for OpenVMS to start automatically when the system boots, you must use the following command to start COM for OpenVMS:
$ @SYS$STARTUP:DCOM$STARTUP |
After you install the COM for OpenVMS kit, do the following:
This chapter describes how to configure your OpenVMS system (and, optionally, your Windows NT system) to develop and deploy COM applications. It describes the following COM for OpenVMS utilities:
This chapter also includes information about configuring OpenVMS and Windows NT systems to interoperate.
Before you configure COM for OpenVMS on your OpenVMS system, you must install and configure required components and install COM for OpenVMS. See Chapter 4 for information about these steps. |
DCOM$SETUP is a collection of tools to help a system manager configure the COM for OpenVMS system environment. Use DCOM$SETUP to populate the OpenVMS Registry database with COM for OpenVMS keys and values.
DCOM$SETUP Conventions and Requirements
To run DCOM$SETUP, enter @SYS$STARTUP:DCOM$SETUP at the OpenVMS system prompt.
The system displays the OpenVMS COM Tools menu.
Figure 5-1 DCOM$SETUP OpenVMS COM Tools Menu
---------------------------------------------------------
OpenVMS COM Tools
1) DCOMCNFG, COM Configuration Properties
2) GUIDGEN, Globally Unique Identifier Generator
3) Populate the Registry database for COM
4) Start the COM server
5) Stop the COM server
6) Register a COM application
7) Create the DCOM$GUEST account and directory
H) Help
E) Exit
Please enter your choice:
---------------------------------------------------------
|
To choose an option, enter the option number. The options are as follows:
COM for OpenVMS requires that the COM server process (DCOM$RPCSS) always be running. The DCOM$RPCSS process on OpenVMS provides the same functions for the COM run-time environment that the RPCSS process provides on Microsoft Windows NT, including the following:
To start DCOM$RPCSS, either use DCOM$SETUP option 4 ("Start") (see Section 5.2) or call the COM for OpenVMS startup procedure directly from SYS$STARTUP:DCOM$STARTUP.
To stop DCOM$RPCSS on your system, either use the
DCOM$SETUP option 5 ("Stop") (see Section 5.2) or
call the COM for OpenVMS shutdown procedure directly from
SYS$STARTUP:DCOM$SHUTDOWN.
5.2.2 Registering an Application
The following example shows how to register the COM for OpenVMS "Simple" application included on the COM for OpenVMS kit. You can use the resulting Windows NT file to register the server on a Windows NT system as long as the application is available on your Windows NT system.
To build the "Simple" application on a Windows NT system, see and execute the instructions in the README-SIMPLE.TXT file in DCOM$EXAMPLES:[SIMPLE].
You must build and compile the application before you can register it. For complete details, see the step-by-step example in [SYSHLP.EXAMPLES.DCOM.SIMPLE], included in the COM for OpenVMS kit. |
Use the following procedure:
The "Simple" application already has a CLSID. |
| Example 5-1 Sample" Simple" Application Registration on OpenVMS |
|---|
Enter server type (1. In-Proc 2. Out-Proc): 2 [Return]
Enter Local Path (device:[directory]filename.ext): USER:[SMITH]SSERVER.EXE [Return]
Enter Application Name (<RETURN> to assign default): COM Simple Server [Return]
Does the server have a CLSid {GUID} (Yes/No) [N]: Y [Return]
Enter the CLSid (i.e. {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}:
{5e9ddec7-5767-11cf-beab-00aa006c3606} [Return]
Verify Application Information:
Application Name: COM SIMPLE SERVER
Local Path: USER:[SMITH]SSERVER.EXE
Application ID: {5E9DDEC7-5767-11CF-BEAB-00AA006C3606}
Is the information correct (Yes/No) [Y]: [Return]
Register application (Yes/No)? [Y]: [Return]
SETUP-I-NEWFILES, The following files have been created:
USER:[SMITH]SSERVER.REG_NT
USER:[SMITH]SSERVER.REG_VMS
SETUP-I-SRVIN, Server has been registered
Press RETURN to continue: [Return]
|
To register the "Simple" application on a Windows NT system, use the following procedure:
Example 5-2 shows the contents of SSERVER.REG_NT.
| Example 5-2 Contents of SSERVER.REG_NT |
|---|
REGEDIT
HKEY_CLASSES_ROOT\CLSID\{5E9DDEC7-5767-11CF-BEAB-00AA006C3606}\ = DCOM server application SSERVER
HKEY_CLASSES_ROOT\CLSID\{5E9DDEC7-5767-11CF-BEAB-00AA006C3606}\LaunchPermission = Y
HKEY_CLASSES_ROOT\CLSID\{5E9DDEC7-5767-11CF-BEAB-00AA006C3606}\LocalServer32 = DEVICE:\SSERVER
|
To reregister the "Simple" application on an OpenVMS system, enter the following command at the system prompt:
$ @SSERVER.REG_VMS |
Example 5-3 shows the contents of the SSERVER.REG_VMS command procedure:
| Example 5-3 Contents of SSERVER.REG_VMS |
|---|
$ Set noon
$ regcp := $regcp
$ crekey := $regcp create key
$ creval := $regcp create value
$ modval := $regcp modify value
$ lisval := $regcp list value
$ crekey HKEY_CLASSES_ROOT\CLSID\{5E9DDEC7-5767-11CF-BEAB-00AA006C3606}
$ creval HKEY_CLASSES_ROOT\CLSID\{5E9DDEC7-5767-11CF-BEAB-00AA006C3606} -
/data="DCOM server application SSERVER" /type=sz
$ creval HKEY_CLASSES_ROOT\CLSID\{5E9DDEC7-5767-11CF-BEAB-00AA006C3606} /name="AppID" -
/data="{5E9DDEC7-5767-11CF-BEAB-00AA006C3606}" /type=sz
$ crekey HKEY_CLASSES_ROOT\CLSID\{5E9DDEC7-5767-11CF-BEAB-00AA006C3606}\LaunchPermission
$ creval HKEY_CLASSES_ROOT\CLSID\{5E9DDEC7-5767-11CF-BEAB-00AA006C3606}\LaunchPermission -
/data="Y" /type=sz
$ crekey HKEY_CLASSES_ROOT\CLSID\{5E9DDEC7-5767-11CF-BEAB-00AA006C3606}\LocalServer32
$ creval HKEY_CLASSES_ROOT\CLSID\{5E9DDEC7-5767-11CF-BEAB-00AA006C3606}\LocalServer32 -
/data="USER::[SMITH]SSERVER.EXE" /type=sz
$
|
DCOM$CNFG is a utility to help COM developers configure and manage COM for OpenVMS applications on OpenVMS. Use the DCOM$CNFG utility to query information and manipulate properties of COM for OpenVMS applications.
To use the DCOM$CNFG utility, from the DCOM$SETUP menu, choose option 1.
You must have OpenVMS Registry Read access to read application properties, and Write access to modify application properties. |
The system displays the DCOM$CNFG Main menu.
Figure 5-2 DCOM$CNFG Main Menu
---------------------------------------------------------
DCOM$CNFG Main
1 - Applications List
2 - System-wide Default Properties
3 - System-wide Default Security
(E to Exit)
(H for Help)
Enter <CTRL-Z> or 'E' to return to the previous menu at any time
Please enter your choice:
---------------------------------------------------------
|
To display this submenu, from the DCOM$CNFG Main menu, choose option 1. The system displays the Applications List submenu.
Figure 5-3 Applications List Submenu
---------------------------------------------------------
Applications List
Index Name
1 Inside COM, Chapter 11 Example
2 application 2
3 application 3
. ...
. ...
. ...
(E to Exit to previous menu)
(H for Help)
Please enter Index number to select an Application:
---------------------------------------------------------
|
Enter a number to select an application. You can then view or configure its properties.
This option displays the Application Properties submenu.
Figure 5-4 Application Properties Submenu
------------------------------------------------------------------
Application Properties
General Properties of this DCOM Application
Application name: Inside COM, Chapter 11 Example
Application id: {0C092C2C-882C-11CF-A6BB-0080C7B2D682}
Application type: local server
Local path: DISK1:[SMITH.DISPATCH_SAMPLE1]CMPNT.EXE
Type Library: {D3011EE1-B997-11CF-A6BB-0080C7B2D682}
version: 1.0 DISK1:[SMITH.DISPATCH_SAMPLE1]Server.tlb
1 - Location Machine to run application
2 - Security Security permissions for application
3 - Identity User account to use to run application
(E to Exit to previous menu)
(H for Help)
Please enter Application Property you wish to change:
------------------------------------------------------------------
|
If the system cannot find the type library file or if the type library is unaccessible, the system displays an error message next to the type library file name.
Figure 5-5 Application Location Submenu
---------------------------------------------------------
Application Location
The following settings allow DCOM to locate the correct computer
for this application. If more than one machine is selected then
DCOM uses the first available one. Client applications may override
these selections.
Application name: Inside COM, Chapter 11 Example
1 - Run application on this computer (Yes/No)
Current value: Yes
2 - Run application on another computer
Current value: Currently Disabled
(E to Exit to previous menu)
(H for Help)
Please enter your choice:
---------------------------------------------------------
|
Figure 5-6 Application Identity Submenu
---------------------------------------------------------
Application Identity
Which user account do you want to use to run this application?
Application name: Inside COM, Chapter 11 Example
Current Identity: OpenVMS DCOM Guest Account
1 - Launching User
2 - NTLM Account
3 - OpenVMS Username
4 - OpenVMS DCOM Guest Account
(E to Exit to previous menu)
(H for Help)
Please enter account you wish to use:
---------------------------------------------------------
|
To display this submenu, from the DCOM$CNFG Main menu, choose option 2. The system displays the System-wide Default Properties submenu:
Figure 5-7 System-wide Default Properties Submenu
---------------------------------------------------------
System-wide Default Properties
1 - Enable Distributed COM on this computer (Yes/No)
Current value: Yes
2 - Default Authentication Level
3 - Default Impersonation Level
4 - Provide additional security for reference tracking (Yes/No)
(E to Exit to previous menu)
(H for Help)
Please enter your choice:
---------------------------------------------------------
|
COM Version 1.0 for OpenVMS does not support security on COM objects, including activation security. For COM objects to interoperate correctly between OpenVMS systems and Windows NT, you must configure these objects to run without security enabled. |
Before any COM applications can interoperate with Windows NT and
OpenVMS, you must set certain values in the Windows NT Registry and in the
OpenVMS Registry.
5.4.1 Configuring the OpenVMS System
The DCOM$SETUP utility sets the OpenVMS Registry values by
default when you choose the POPULATE option (see
Section 5.2).
5.4.2 Configuring the Windows NT System
On Windows NT systems, you must set the Windows NT Registry values by using the Windows NT Registry editor. To set the Windows NT Registry values, use the following procedure:
HKEY_LOCAL_MACHINE\Software\Microsoft\Ole |
| Value name | Value | Registry type |
|---|---|---|
| ActivationSecurity | N | REG_SZ |
| PersonalClasses | N | REG_SZ |
| LegacyAuthenticationLevel | 1 | REG_DWORD |
| LegacyImpersonationLevel | 3 | REG_DWORD |
Before you can run a COM application on Windows NT, you must register the application's CLSID (see Section 5.2) and set its security properties.
For simple applications developed on OpenVMS, go to the DCOM$SETUP Main menu, and choose option 6 (Register a COM application) (see Section 5.2). This option creates an OpenVMS command procedure that registers the component on OpenVMS. It also creates a Windows NT Registry file that you can copy to a Windows NT system and run with the Windows NT Registry editor.
For applications whose registration process is more complex, see Section 6.6.
Setting the Security Properties
After you register the component, check the security properties on that component to ensure that an unauthenticated user can activate the image. To do this, run DCOMCNFG on the Windows NT system, select the object by name, click the Properties... button, then click the Security tab.
After you set security properties, you must set the identity of the account to run the application.
To do this, click the Identity tab, then click the
button next to The interactive user.
5.5 Registering In-Process Servers: DCOM$REGSVR32 Utility
All COM components (implemented as either an out-of-process server or as an in-process server) must be registered in the OpenVMS Registry before you can use them.
Out-of-process servers, which are implemented as executable programs (.EXE files), usually contain code to register and unregister the components contained within them. The advantage an out-of-process server has over an in-process server is that you can run the executable and automatically create the necessary registry keys.
In-process servers, which are usually implemented as dynamic link libraries (DLL files) on Windows NT or as shareable images on OpenVMS, also contain code to register and unregister the components within them automatically. However, these in-process servers cannot be run the same way as an executable image because they do not contain a main entry point. As a result, you must manually register the components contained within a .DLL, or create a command procedure to perform the registration.
Microsoft provides the REGSVR32 utility that you can use to register the components contained within a DLL. REGSVR32 takes as a command line argument the following:
When registering a DLL's components, REGSVR32 searches the specified DLL for the DllRegisterServer symbol and, if found, calls it. When unregistering a DLL, REGSVR32 calls DllUnregisterServer. This means that all in-process components that you want to register automatically must include these two entry points in their export files.
To facilitate the registration of components contained within shareable images on OpenVMS systems, Compaq created the DCOM$REGSVR32 utility. DCOM$REGSVR32 does the same things that the Microsoft REGSVR32 utility does. Any shareable images that contain components to be registered must also include the DllRegisterServer and DllUnregisterServer universal symbols in their symbol vectors. Both the DCOM$REGSVR32 and the REGSVR32 utilities use the same command line syntax.
During the COM for OpenVMS installation, the system places the DCOM$REGSVR32.EXE file in the SYS$SYSTEM directory.
Before you use the DCOM$REGSVR32 utility, you must define a symbol that allows the utility to accept foreign command lines. For example:
$ regsvr32 :== $DCOM$REGSVR32 |
Alternatively, you can activate the DCOM$REGSVR32 utility as follows:
$ MCR DCOM$REGSVR32 |
You can use either method to activate the utility, and register or unregister components contained in shareable images.
To display help for DCOM$REGSVR32, enter the following:
$ regsvr32 -? |
Table 5-1 summarizes the DCOM$REGSVR32 command line options.
| Switch | Use |
|---|---|
| -?, /? | Display help file (this table). |
| shareable-image-name | Register the specified shareable image name. |
| -u or /u image-name | Unregister the specified shareable image name. |
DCOM$REGSVR32 requires that the shareable image name contain a full directory specification. |
Example 5-4 demonstrates registering an in-process component (contained within a shareable image) using the DCOM$REGSVR32 utility.
| Example 5-4 Registering a Component Using the DCOM$REGSVR32 Utility |
|---|
$ regsvr32 USER$DISK:[SEYMOUR.DISPATCH_SAMPLE1]CMPNT$SHR.EXE
Class factory: Create self.
DllRegisterServer: Registering Server DLL
Creating key CLSID\{0C092C2C-882C-11CF-A6BB-0080C7B2D682}
Creating key CLSID\{0C092C2C-882C-11CF-A6BB-0080C7B2D682}\InProcServer32
Creating key CLSID\{0C092C2C-882C-11CF-A6BB-0080C7B2D682}\ProgID
Creating key
CLSID\{0C092C2C-882C-11CF-A6BB-0080C7B2D682}\VersionIndependentProgID
Creating key CLSID\{0C092C2C-882C-11CF-A6BB-0080C7B2D682}\TypeLib
Creating key InsideCOM.Chap11
Creating key InsideCOM.Chap11\CLSID
Creating key InsideCOM.Chap11\CurVer
Creating key InsideCOM.Chap11.1
Creating key InsideCOM.Chap11.1\CLSID
Class factory: Destroy self.
|
Example 5-5 demonstrates unregistering an in-process component (contained within a shareable image) using the DCOM$REGSVR32 utility.
| Example 5-5 Unregistering a Component Using the DCOM$REGSVR32 Utility |
|---|
$ regsvr32 /u USER$DISK:[SEYMOUR.DISPATCH_SAMPLE1]CMPNT$SHR.EXE
Class factory: Create self.
DllUnregisterServer: Unregistering Server DLL
Deleting key InProcServer32
Deleting key ProgID
Deleting key VersionIndependentProgID
Deleting key TypeLib
Deleting key LocalServer32
Deleting key CLSID\{0C092C2C-882C-11CF-A6BB-0080C7B2D682}
Deleting key CLSID
Deleting key CurVer
Deleting key InsideCOM.Chap11
Deleting key CLSID
Deleting key InsideCOM.Chap11.1
Class factory: Destroy self.
|
This chapter explains how to develop COM applications for OpenVMS.
The following sections describe how to create a COM for OpenVMS application.
Building COM for OpenVMS applications places demands on the virtual memory requirements of a process. You should have a minimum page file quota of 100,000 pagelets before building a COM for OpenVMS application. This is a DEC C++ compiler requirement. |
Use the DCOM$GUIDGEN utility to generate 16-byte globally unique identifiers (GUIDs). The utility supports both OpenVMS and UNIX styles. For example:
$ SET COMMAND DCOM$LIBRARY:DCOM$GUIDGEN.CLD $ DCOM$GUIDGEN [/FORMAT=value] [/COUNT=value] [/OUTPUT=value] |
$ mcr dcom$guidgen [-cdghirs?] [-on] |
The following table summarizes the GUID format options.
| OpenVMS qualifier (value) | UNIX switch | Use |
|---|---|---|
| IDL | -i | Output GUID in an IDL interface template. |
| STRUCT | -s | Output GUID as an initialized C struct. |
| IMPLEMENT_OLECREATE | -c | Output GUID in IMPLEMENT_OLECREATE(...) format. |
| DEFINE_GUID | -d | Output GUID in DEFINE_GUID(...) format. |
| GUID_STRUCT | -g | Output GUID as an initialized static const GUID struct. |
| REGISTRY_GUID | -r | Output GUID in registry format. |
The last four options in the preceding table are the same as the four options in the Windows NT Guidgen utility. |
The following table lists additional options supported by the DCOM$GUIDGEN utility.
| OpenVMS qualifier | UNIX switch | Use |
|---|---|---|
| /OUTPUT= filename | -o filename | Redirect output to a specified file. |
| /COUNT= number | -n number | Number of GUIDs to generate. |
| not available | -h, -? | Display command option summary. |
You can specify more than one format for the same GUID.
6.3 Step 2: Build an Application Using the MIDL Compiler
The following sections describe how to use the MIDL compiler to build
an application.
6.3.1 Running the MIDL Compiler
The MIDL compiler consists of the following separate images:
To run MIDL, you must first define a DCL symbol. For example:
$ midl :== $dcom$midl
$ midl -?
$ midl -Oicf -idcom$library: example.idl
|
The midl -? command displays a list of valid command line
arguments. For a list of these arguments, see Appendix A.
6.3.2 Running the MIDL Compiler with DCOM$RUNSHRLIB
The DCOM$MIDL.EXE utility gets its arguments from the DCL foreign command line buffer. DCL foreign commands can have a maximum of 255 characters.
Because of the number of arguments that DCOM$MIDL.EXE can accept, you might exceed this maximum number of characters if you specify a complex MIDL command (for example, a command that contains mixed-case arguments that require quotation marks).
As a workaround, you can use the SYS$SYSTEM:DCOM$RUNSHRLIB.EXE utility. Use the following procedure:
$ SET COMMAND DCOM$LIBRARY:DCOM$RUNSHRLIB.CLD |
| Argument | Value | Required/Optional |
|---|---|---|
| P1 | Name of the shareable image library. This can be a logical name, the name of an image in SYS$SHARE:, or a full file specification. | Required |
| P2 | Name of the routine to be called as a C or C++ main() routine with an argc/argv vector. | Required |
| P3 | List of qualifiers in quotation marks. | Optional |
$ midl :== DCOM$RUNSHRLIB DCOM$MIDL_SHR DCOM$MIDL_MAIN |
$ midl :== $dcom$midl
$ midl -Zp8 -Oicf -Os -oldnames -char unsigned -
-error allocation -error bounds_check -error stub_data -
-ms_ext -c_ext -out [.OBJ] -
-I[INC] -I[PROJECT_WIDE_INC] -I[COMMON_INC] -IDCOM$LIBRARY: -
-DRMS_DB "-DOpenVMS_Definitions" "-DPermanentProcess" -
-header [.obj]example.h -client none -server none example.idl
%DCL-W-TKNOVF, command element is too long - shorten
|
$ set command dcom$library:dcom$runshrlib.cld
$ midl :== DCOM$RUNSHRLIB DCOM$MIDL_SHR DCOM$MIDL_MAIN
$ midl "-Zp8 -Oicf -Os -oldnames -char unsigned",-
"-error allocation -error bounds_check -error stub_data",-
"-ms_ext -c_ext -out [.OBJ]",-
"-I[INC] -I[PROJECT_WIDE_INC] -I[COMMON_INC] -IDCOM$LIBRARY:",-
"-DRMS_DB -DOpenVMS_Definitions -DPermanentProcess",-
"-header [.obj]example.h -client none -server none example.idl"
|
When running MIDL on OpenVMS, you must specify the -Oicf MIDL
command line switch.
6.3.4 Required Include Directories
MIDL components typically import UNKNWN.IDL, which contains the component definitions for IUnknown and IClassFactory. UNKNWN.IDL and other COM-related IDL and header files are located in DCOM$LIBRARY. To build your component's IDL file, use the following switch:
-IDCOM$LIBRARY: |
The VMS_DCOM.H header file contains macro definitions that enable your COM for OpenVMS application to compile properly with Bristol's Wind/U® Win32 environment. You must include this header file in every source file and header file you create that relies on COM APIs or Win32 APIs. Because the files generated by MIDL rely on parts of the Win32 environment, Compaq has modified the MIDL compiler for OpenVMS to include VMS_DCOM.H in all output files.
If you included references to VMS_DCOM.H in your IDL source files, you can remove the IDL cpp_quote() directives. That is, if you added the following code to your source files for COM for OpenVMS EFT1, you can delete it:
|
The following sections describe how to compile COM for OpenVMS applications.
When you develop COM applications that require Read access to the OpenVMS Registry, you must be sure that you have the REG$LOOKUP identifier. For applications that require Read and Write access to the OpenVMS Registry (either during development or at run time), you must have either the REG$UPDATE identifier or the SYSPRV privilege. For more information about OpenVMS Registry privileges, see Section 7.5.1. |
The VMS_DCOM.H file defines several macros used by the Wind/U Win32 environment. An include statement that specifies this header file should be the first noncommented line in any source file (code or header files) that you write. However, this is not always guaranteed to be true for files generated by MIDL. Be sure to always include the following /DEFINE qualifier on all of your C and CXX commands:
/DEFINE=(UNICODE=1,_WINDU_SOURCE=0X041000,_WIN32_DCOM) |
The UNICODE macro ensures that the wide character variants of Win32 APIs and data structures are enabled when you compile your code. (This macro is also defined in VMS_DCOM.H.) Omitting this macro can lead to compilation failures when building with the Wind/U Win32 environment.
The other two macro definitions are recognized by the Wind/U header
files and are required to ensure the proper definition of structures
and COM APIs.
6.4.2 Required Include Directories
COM for OpenVMS applications typically require header files that come from DCOM$LIBRARY.
Include the following qualifier on your C and CXX command lines:
/INCLUDE=DCOM$LIBRARY |
If you already have an /INCLUDE qualifier on your command
line, modify the command to include DCOM$LIBRARY.
6.4.3 Required Header File: VMS_DCOM.H
The VMS_DCOM.H header file defines several macros used by the Wind/U header files.
Include this header file as the first noncommented line in your source
files (both header files and implementation files).
6.4.4 Required C++ Qualifiers
| Previous | Next | Contents | Index |
|
Copyright © Compaq Computer Corporation 1999. All rights reserved. |
6539P001.HTM
|