3 Understanding the COM Solution for Business Function Execution

This chapter contains the following topics:

3.1 JD Edwards EnterpriseOne COM Server

The JD Edwards EnterpriseOne COM server contains two parts:

  • COM connector.

  • Generated JD Edwards EnterpriseOne COM components (wrappers).

This diagram shows the two parts of the COM server:

Figure 3-1 Parts of the COM server

Description of Figure 3-1 follows
Description of "Figure 3-1 Parts of the COM server"

3.2 COM Connector

The COM server provides an interface to JD Edwards EnterpriseOne, executes business functions within valid transactions, and provides error processing for interoperability clients. The main component of the COM server is the COM connector. The COM connector provides COM components that interface with JD Edwards EnterpriseOne and hosts the business component DLL generated by the GenCOM tool. The COM connector also provides the connector component that enables an interoperability client to log in and log out from JD Edwards EnterpriseOne. It manages all user sessions connected to the COM server. This table identifies the binaries that combine to comprise the COM connector:

Binary Explanation
JDECOMConnector2.exe Primary interface for login and createBusinessObjects. Also maintains the created users and business objects.
JDECOMMN.dll Interface for JDEMathNumeric and JDETimeZone.
Callobject.dll Internal to JDECOMConnector.exe.
Comlog.dll Used for logging, cache, and OCM lookup.
EventClass.dll JD Edwards EnterpriseOne event class that is implemented to receive events.
EventListener.dll Receives events from the JD Edwards EnterpriseOne server and publishes the events to COM+ Events.
EventManager.dll Provides the interface for subscribe, unsubscribe, getList, and getTemplate for events.
jdeunicode.dll The Unicode library, which is internal to JD Edwards EnterpriseOne.
OneWorldInterfaceTx.dll Provides the interface for JD Edwards EnterpriseOne transactions and COM+ two-phase commit transactions.
Xmlinterop.dll Contains the JDENET transport mechanism and the XMLRequest.
ClientService.dll Enables event notification and introspection using XML over HTTP protocol. Applicable for JD Edwards EnterpriseOne 8.95 and later Tools releases only.
EventHandler.dll Receives events from the Transaction server and publishes events to COM+. Applicable for JD Edwards EnterpriseOne 8.95 and later Tools releases only.
JMSEvent.dll Receives JMS events from the Transaction server and publishes events to COM+. Applicable for JD Edwards EnterpriseOne 8.94 only.

The JDECOMConnector2.idl defines the COM interfaces of the COM connector. JDECOMConnector2.idl is available under the Include directory.

The COM connector is available with the JD Edwards EnterpriseOne server and client install.

3.3 GenCOM Components

This section provides an overview of GenCOM and discusses:

  • Installation information.

  • ProgID.

  • Setting up an environment for GenCOM.

  • Running GenCOM.

  • Using GenCOM output.

3.3.1 Understanding GenCOM

GenCOM is a client tool that uses a multipass process to generate JD Edwards EnterpriseOne COM components. GenCOM is included in the client installation. The COM Generation Tool is in <install>\system\bin32\GenCOM.exe.

GenCOM is a command line tool that reads a script file to determine which components to generate. GenCOM uses an iJDEScript file as input to generate a COM DLL that is hosted by the COM connector. The iJDEScript file specifies wrapper components for business functions. Once the generated wrapper components are registered to the COM environment, they can be used to access business function functionality.

This illustration shows the process:

Figure 3-2 GenCOM process

Description of Figure 3-2 follows
Description of "Figure 3-2 GenCOM process"

  1. GenCOM reads the iJDEScript file.

  2. GenCOM retrieves the metadata for the business functions specified in the iJDEScript file.

  3. GenCOM resolves dependency on the data structure.

  4. GenCOM creates an internal emitter tree for the library to be generated.

  5. GenCOM reads each node of the internal emitter tree and generates the appropriate COM code.

  6. GenCOM generates a make file.

  7. GenCOM compiles and builds the COM DLL from the generated code.

    See Understanding iJDEScript.

3.3.2 Installation Information

Because the GenCOM application produces interfaces based on the package currently installed on the machine, installation plans must be made on a site-by-site basis. The DLLs produced are business function release-dependent and can be installed only on machines with the identical packages available.

The GenCOM output is COM servers in the form of DLLs. You can use these DLLs to create an interface with the JD Edwards EnterpriseOne system. You should not assume that a client has installed these servers as part of the standard JD Edwards EnterpriseOne installation. You should provide a full installation of any of the servers the applications require.

3.3.3 ProgID

Each time GenCOM generates a wrapper, it creates a ProgID for each COM component. The ProgID identifies the COM component in the registry. The ProgID is independent of JD Edwards EnterpriseOne and is based on the library and the interface specifications in the script file. The key, OneWorldRelease, contains the JD Edwards EnterpriseOne release and environment information. For example, if the library name is AddressBook and the interface name is JDEAddressBook, then the ProgID will be AddressBook.JDE AddressBook. If GenCOM is run with environment DV9NIS2, then the OneWorldRelease key contains DV9NIS2. If a type mismatch exists, you receive a warning.

The CompatibleEnvironment key remembers the list of JD Edwards EnterpriseOne environments with which the wrapper is compatible. If an environment is not on the list or is listed as incompatible, the COM client receives an error message when trying to create the object with the environment.

This sample code illustrates the standard ProgID naming conventions:

HKEY CLASSES ROOT\
CLSID\{77454442-7941-44BB-9BCB-4253E80AC8B3)}
\InprocServer32 C:\B9\System\IDA\Samples\AddressBook\AddressBook.dll
\ProgID AddressBook.JDEAddressBook
\VersionIndependentProgID AddressBook.JDEAddressBook
\OneWorldRelease DV9NIS2
\CompatibleEnvironment DV9NIS2

3.3.4 Setting Up an Environment for GenCOM

You can use one of these platforms:

  • Microsoft Studio 6.0

  • Microsoft .NET

  • Microsoft Visual Studio 2005

3.3.4.1 Setting Up an Environment for GenCOM on Microsoft Visual Studio 6.0

Setting up a Microsoft Windows NT client environment involves several steps. You should make sure that these items are set up appropriately:

  • Include directories

  • Lib directories

  • MSDev directories

  • Paths

Note:

Set up this environment for GenGOM if you are using JD Edwards EnterpriseOne Tools 8.94 or an earlier release of JD Edwards EnterpriseOne Tools.

3.3.4.2 Example: Include Directories

< Directory where Microsoft SDK files are located>\include

Example: C:\ Program Files\Microsoft SDK\include

< Directory where Microsoft program files are located>\VC98\atl\include

Example: C:\ Program Files\Microsoft Visual Studio\VC98\atl\include

< Directory where Microsoft program files are located>\VC98\mfc\include

Example: C:\Program Files\Microsoft Visual Studio\VC98\mfc\include

< Directory where Microsoft program files are located>\VC98\include

Example: C:\Program Files\Microsoft Visual Studio\VC98\include

< Directory where JD Edwards EnterpriseOne is located and release either Master, Prod, or Pristine>\include

Example 1: D:\B9\MSTB9\include

Example 2: D:\B9\PROD\include

< Directory where JD Edwards EnterpriseOne is located and release either Master, Prod, or Pristine>\includeV

Example: D:\B9\SYSTEM\includeV

< Directory where JD Edwards EnterpriseOne is located and release either Master, Prod, or Pristine>\include

Example: D:\B9\SYSTEM\include

3.3.4.3 Example: Lib Directories

< Directory where Microsoft SDK files are located>\lib

Example: C:\ Program Files\Microsoft SDK\lib

< Directory where Microsoft program files are located >\VC98\mfc\lib

Example: C:\Program Files\Microsoft Visual Studio\VC98\mfc\lib

< Directory where Microsoft program files are located >\VC98\lib

Example: C:\Program Files\Microsoft Visual Studio\VC98\lib

< Directory where Microsoft program files are located >\Common\MSDev98\Bin

Example: C:\Program Files\Microsoft Visual Studio\Common\MSDev98\Bin

< Directory where JD Edwards EnterpriseOne is located>\System\Lib32

Example: D:\B9\System\Lib32

3.3.4.4 Example: MSDev Directories

< Directory where Microsoft program files are located >\Common\MSDev98

Example: C:\Program Files\Microsoft Visual Studio\Common\MSDev98

< Directory where Microsoft DevStudio is located>\SharedIDE

Example: C:\Program Files\DevStudio\SharedIDE

3.3.4.5 Example: Paths

< Directory where Microsoft SDK files are located>\bin

Example: C:\ Program Files\Microsoft SDK\bin

< Directory where Windows NT is located>\System32

Example: C:\Winnt\System32

< Directory where Microsoft program files are located >\Common\Tools\Winnt

Example: C:\Program Files\Microsoft Visual Studio\Common\Tools\Winnt

< Directory where Microsoft program files are located >\Common\Msdev98\Bin

Example: C:\Program Files\Microsoft Visual Studio\Common\Msdev98\Bin

< Directory where Microsoft program files are located >\Common\Tools

Example: C:\Program Files\Microsoft Visual Studio\Common\Tools

< Directory where Microsoft program files are located >\Vc98\Bin

Example: C:\Program Files\Microsoft Visual Studio\Vc98\Bin

< Directory where Microsoft DevStudio is located>\SharedIDE\Bin\Ide

Example: C:\Program Files\DevStudio\SharedIDE\Bin\Ide

< Directory where Microsoft DevStudio is located>\SharedIDE\Bin

Example: C:\Program Files\DevStudio\SharedIDE\Bin

< Directory where JD Edwards EnterpriseOne is located>\System\Bin32

Example: D:\B9\System\Bin32

In an Microsoft Windows NT environment, binaries are not compatible between the client and server machine. Do not copy .dll files or .exe files compiled on an NT workstation to an NT server. The struct alignments required by the JD Edwards EnterpriseOne server and the JD Edwards EnterpriseOne client are different.

3.3.4.6 Setting Up an Environment for GenCOM on Microsoft Visual Studio.NET

Setting up a Microsoft Windows NT client environment involves several steps. You should make sure that these items are set up appropriately:

  • Include directories

  • Lib directories

  • Paths

  • Basemake directory

  • Bkoffice directory

  • DXSDKROOT directory

  • INETSDK directory

Important:

Set up this environment for GenCom if you are using JD Edwards EnterpriseOne Tools 8.95 or later Tools releases. To avoid path-related issues, uninstall Visual Studio 6.0. If you require both Visual Studio.NET and Visual Studio 6.0, avoid path-related issues by ensuring that the Visual Studio.NET items precede the Visual Studio 6.0 items.

3.3.4.7 Example: Include Directories

<Directory where Microsoft Visual Studio .NET files are located>\include

Example: C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include

Example: C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include

Example: C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include

<Directory where JD Edwards EnterpriseOne is located and release either Master, Prod, or Pristine>\include

Example: C:\B9\System\include

Example: C:\B9\System\includev

Example: C:\B9\STAGINGA\include

Example: C:\E11\System\include

Example: C:\E11\System\includev

Example: C:\E11\STAGINGA\include

3.3.4.8 Example: Lib Directories

< Directory where Microsoft Visual Studio .NET files are located>\lib

Example: C:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Lib\

Example: C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\lib

Example: C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\lib

< Directory where JD Edwards EnterpriseOne is located>\System\Lib32

Example: C:\B9\system\Lib32

Example: C:\E11\system\Lib32

3.3.4.9 Example: Paths

< Directory where Microsoft Visual Studio .NET files are located>

Example: C:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Bin

Example: C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Tools

Example: C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Tools\Bin

Example: C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin

Example: C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK

< Directory where Windows NT is located>

Example: C:\Winnt\System32

3.3.4.10 Example: Basemake Directories

Example: C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\BKOffice.Mak

3.3.4.11 Example: Bkoffice Directories

Example: C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK

3.3.4.12 Example: DXSDKROOT Directories

Example: C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK

3.3.4.13 Example: INETSDK Directories

Example: C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK

3.3.5 Setting Up an Environment for GenCOM on Microsoft Visual Studio 2005

Setting up a Microsoft Windows NT client environment involves several steps. You should make sure that these items are set up appropriately:

  • Include directories

  • Lib Directories

  • Paths

  • Basemake directory

  • BKoffice directory

  • DXSDKROOT directory

  • INETSDK directory

Important:

Set up this environment for GenCom if you are using JD Edwards EnterpriseOne Tools 8.95 or later Tools release. To avoid path-related issues, uninstall Visual Studio.NET. If you require both Visual Studio 2005 and Visual Studio.NET, avoid path-related issues by ensuring that the Visual Studio 2005 items precede the Visual Studio.NET items.

3.3.5.1 Example: Include Directories

<Directory where Microsoft Visual Studio 2005 files are located>\include

Example: C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\Include

Example: C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\include

Example: C:\Program Files\Microsoft Visual Studio 8\VC\include

<Directory where JD Edwards EnterpriseOne is located and release either Master, Prod, or Pristine>\include

Example: C:\B9\System\include

Example: C:\B9\System\includev

Example: C:\B9\STAGINGA\include

Example: C:\E811\System\include

Example: C:\E811\System\includev

Example: C:\E811\STAGINGA\include

Example: C:\E812\System\include

Example: C:\E812\System\includev

Example: C:\E812\STAGINGA\include

3.3.5.2 Example: Lib Directories

< Directory where Microsoft Visual Studio 2005 files are located>\lib

Example: C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Lib

Example: C:\Program Files\Microsoft Visual Studio 8\VC\lib

Example: C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\lib

< Directory where JD Edwards EnterpriseOne is located>\System\Lib32

Example: C:\B9\system\Lib32

Example: C:\E811\system\Lib32

Example: C:\E812\system\Lib32

3.3.5.3 Example: Paths

< Directory where Microsoft Visual Studio 2005 files are located>

Example: C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin

Example: C:\Program Files\Microsoft Visual Studio 8\Common7\Tools

Example: C:\Program Files\Microsoft Visual Studio 8\Common7\Tools\Bin

Example: C:\Program Files\Microsoft Visual Studio 8\VC\bin

Example: C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\

< Directory where Windows NT is located>

Example: C:\Winnt\System32

3.3.5.4 Example: Basemake Directories

Example: C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\Include\BK Office.Mak

3.3.5.5 Example: Bkoffice Directories

Example: C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK

3.3.5.6 Example: DXSDKROOT Directories

Example: C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK

3.3.5.7 INETSDK directory

Example: C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK

3.3.6 Running GenCOM

You run GenCOM from the command line to expose objects through COM. In a development environment, developers may run the COM Generation tool. In a production environment, a system administrator should run the COM Generation Tool.

To run GenCOM in Visual Studio 2005, include this setting in the JD Edwards EnterpriseOne Client jde.ini File, [JDE_CG] section:

VisualStudioVersion=8

When you use GenCOM, use the iJDEScript scripting language to script code generation activities. The syntax is:

GenCOM [options] [libraries]

For example, if you want to see available libraries that you can run GenCOM against, you enter the command C:\B9\System\Bin32>gencom /ListLibraries from the system command line.

To generate COM wrappers for Category 1 business functions in the CAEC library, enter this command from the command line:

GenCOM /Cat 1 /UserID Devuser1 /Password Devuser1 /Environment ADEVHP02 CAEC

Options available for generation include:

Option Description
/? Lists the options available for generation.
/C++ <option> Provides GenCOM with the compiler options you want to use in the generation of the COM servers.
/Cat <category> Tells GenCOM to generate wrappers based on these categories:

master business functions

major business functions

minor business functions

uncategorized business functions

/CL <file> Tells GenCOM what compiler (.exe) to use for compilation.
/Cmd * Processes code generation commands from the console.
/Cmd <filename> Processes code generation commands from <filename>.
/Debug Builds debug information (.pdb and .bsc files) into the libraries so that the Visual Studio debugger can access source information.
/EnvironmentID <env> Provides GenCOM with the environment in which you want to sign in to JD Edwards EnterpriseOne.
/ErrFile <file> Provides GenCOM with the filename to log errors produced by GenCOM during the generation process, for example, errors.log.
/MIDL Provides GenCOM with the MIDL compiler options you wish to use in the generation of the COM servers.
/MTL <file> Tells which MIDL compiler (.exe) to use for compilation.
/ListLibraries Lists all the available libraries against which you can run GenCOM.
/MsgFile <file> Provides GenCOM with the filename to log messages produced by GenCOM during the generation process, for example, messages.log.
/NoBSFN Tells GenCOM not to create wrappers for business functions. This option is for generating parameter sets only.
/NoCompile Tells GenCOM to generate the source files without compiling.
/NoDebug Optimizes libraries for space using the /O1 Visual C++ compiler option.
/Out <path> Provides GenCOM with the directory path in which to place the output files, for example C:\winnt\system32.
/OWRelease flag for GenCOM You can override the OWRelease information by activating this flag and typing a string that specifies the version information. The recommendation is that you follow a naming convention that is consistent throughout the implementation or use the default version information that is generated by GenCOM.
/Password <password> Provides GenCOM with the password with which you want to sign in to JD Edwards EnterpriseOne.
/Role Provides GenCOM with the role with which you want to sign in to JD Edwards EnterpriseOne.
/STA Generates STA components. (By default, all generated components are MTA and are optimized for scalability and performance. /STA enables you to generate STA components if you need them.)
/TempOut <path> Provides GenCOM with the directory path in which to place temporary files needed for the build process, for example, C:\temp.
/UserID <userid> Provides GenCOM with the user name with which you wish to sign in to JD Edwards EnterpriseOne.

3.3.7 Using GenCOM Output

The output for GenCOM produces fully functional COM servers based on the library to which you generate wrappers. Because you are interacting with the JD Edwards EnterpriseOne system, you must follow security and installation procedures to gain access to the system.

You must have a fully licensed copy of JD Edwards EnterpriseOne properly installed on the target machine. You must also sign in to the JD Edwards EnterpriseOne environment. For the sign-in process, you use the jdeCOMConnector interface.

3.3.7.1 Visual Basic

This code example demonstrates how to use a generated COM business function wrapper in Visual Basic. This example creates business objects. Refer to the AddressBook sample included with the COM interoperability software for a complete working example of this functionality.

Dim WithEvents OW As OneWorldInterface '//OneWorldInterface
Dim conn As New Connector '//COM Connector
Dim connRole As IConnector2 '//Connector Interface with role
Dim AB as JDEAddressBook '//AddressBook
Dim phone as D0100032 '//Data Source
Dim Mailing As D0100031 '//Data Source
Dim AddressAs D0100033 '//Data Source
Dim EffectiveDate As D0100019 '//Data Source
DimParentAddress As D0100381 '//Data Source
Dim sessionID As Long '//server Session ID
Private Sub Form_Load()
Set connRole = conn
'sessionID=conn.Login("Foo", "Bar", "DV9NIS2", "*ALL")
sessionID=connRole.Login("Foo", "Bar", "DV9NIS2", "*ALL")
Set OW = conn.CreateBusinessObject("OneWorld.FunctionHelper.1", sessionID)
Set AB = conn.CreateBusinessObject("AddressBook.JDEAddressBook", sessionID)
Set phone = AB.CreateGetPhoneParameterset
Set Mailing = AB.CreateGetMailingNameParameterset
SetAddress = AB.CreateGetEffectiveAddressParameterset
Set EffectiveDate = AB.CreateGetABEffectiveDateParameterset
Set ParentAddress = AB.CreateGetParentAddressParameterset
End Sub

3.3.7.2 Visual C++

This Visual C++ code example demonstrates how to create the connector and how to create a business function on the COM server. This example creates an AddressBook business function and uses GenCOM objects from C++.

#include <windows.h>
#include <stdio.h>
#include <objbase.h>
#include <comdef.h>
#include <wchar.h>
#include addressbook.h
#include AddressBook_i.c
#include jdecomconnector2.h
#include jdecomconnector2_i.c
#define IPhone ID0100032
#define IMailing ID0100031
#define IAddress ID0100033
#define IEffectiveDate ID0100019
#define IParentAddress ID0100381
#define SERVER OLESTR("COMSRV") //Change to the COM server.
#define ABNO 4242 //change this according to user input.
HRESULT CreateConnector( IConnector **ppConnector )
{
  HRESULT hr = E_FAIL;

  *ppConnector = 0;

//NOTE: Pass a COSERVERINFO struct to activate on a remote machine
  COSERVERINFO csi = {0, SERVER, 0, 0};
  MULTI_QI mqi = { &IID_IConnector, 0, 0 };
  hr = CoCreateInstanceEx(CLSID_Connector, 0, CLSCTX_LOCAL_SERVER,
         0, // &csi,
         1, &mqi);

  if(SUCCEEDED(hr) && SUCCEEDED(mqi.hr))
  {
    ppConnector = reinterpret_cast<IConnector*>(mqi.pItf);
  }
return hr;
}

HRESULT Login( IConnector **pConnector, IOneWorldInterface **ow, 
long *accessno )
{
  HRESULT hr;
  IDispatch *idsptch = 0;

  printf("Login started\n");
  bstr_t User(L "Foo "), PassWord(L"Bar "), Env("DV9NIS2");
hr = (*pConnector)->Login(User,PassWord,Env,accessno );

if( !SUCCEEDED(hr))
{
  printf( "Login failed with hr = %x",hr);
  return E_FAIL;
}
_bstr_t bo("OneWorld_FunctionHelper.1");
hr=(*pConnector)->CreateBusinessObject(bo, *accessno, &idsptch );
if( !SUCCEEDED(hr)||(!ow))
{
 Printf("CreateBusinessObject(OneWorld.FunctionHelper.1) failed 
with hr %x",hr);
 return E_FAIL;
}
hr=idsptch->QueryInterface(IID_IOneWorldInterface, (void **)ow );
if(!SUCCEEDED(hr)||(!ow))
{
 Printf( QueryInterface for IOneWorldInterface failed with hr "%x",hr);
 return E_FAIL
}
printf("Login completed \n");
return S_OK;
}
HRESULT UseAddressBook(IConnector *pConnector, IOneWorldInterface 
*ow, long*accessno)
{
HRESULT hr;
IJDEAddressBook *ab;
IDispatch *idsptch;
IPhone *phone;
IMailing *Mailing;
IAddress *Address;
IEffectiveDate *EffectiveDate;
IParentAddress ParentAddress;

printf("Starting to use AddressBook\n");
_bstr_t bo("AddressBook.JDEAddressBook");
hr = pConnector->CreateBusinessObject(bo, *accessno, &idsptch);
hr = idsptch->QueryInterface( IID_IJDEAddressBook, (void **&ab);

if(!SUCCEEDED(hr)||(tab))
{
 printf( "CreateBusinessObject( AddressBook ) has failed with hr %x", 
hr);
 return E_FAIL;
}
return S_OK;
}

This code creates the connector object and uses it to create a business function with its associated ParameterSet. The code then calls a method, Foo1, on the business object with the ParameterSet, the connector, and the access code returned by the act of logging on to the connector.

Int main(int argc, char *argv[])
{
HRESULT hr;
IOneWorldInterface *ow;
long accessno;
IConnector *pConnector;
hr - CoInitializeEx(0, COINIT_MULTITHREADED);
if(SUCCEEDED(hr))
(
 hr = CreateConnector(&pConnector);
 if(SUCCEEDED(hr))
 {
 Login( &pConnector, &ow, &accessno );
//Do more processing with AddressBook and logoff at the end.
}
 CoUninitialize();
}

3.4 COM Wrapper CheckVer

You can run CheckVer to verify whether a previously generated COM object is compatible with another environment. Typically, a system administrator performs this task.

The XML files generated by GenCOM are the signatures of the objects generated against specific JD Edwards EnterpriseOne environments. These XML files can be used with CheckVer to verify that the wrappers on the COM server are compatible with these environments.

When you introduce a new JD Edwards EnterpriseOne environment, you run GenCOM against the new environment by using the /NoCompile option. You also use the iJDEScript that you used to generate the wrappers on the COM server to generate XML signature files for the objects in the new environment. Run CheckVer on the COM server with the newly generated XML files to verify that the new environment is compatible with wrappers on the COM server that was previously generated with a different environment. CheckVer updates the registry settings for the wrapper on the COM server according to the result of the compatibility test. If the new environment is incompatible, the COM client cannot create business objects with the new environment.

3.4.1 Running CheckVer

CheckVer compares the XML signature file that is produced from GenCOM with the spec definitions on the local JD Edwards EnterpriseOne client machine. You can run CheckVer from the command line on the COM server, or CheckVer can be run automatically as part of the GenCOM process.

To see the options that CheckVer provides, run this command from the command line:

c:\>CheckVer.exe -?

3.4.1.1 Syntax

CheckVer [option] <filename>

3.4.1.2 Example

CheckVer -r addressbook.xml

3.4.1.3 Options

-r -- CheckVer reports only whether the environment is compatible with the server. It does not update the registry settings for the wrapper on the COM server with the result, and CheckVer does not validate the wrapper DLL.