Setting Up Your Programming Environment

Setting up your build environment to work with P&M depends primarily on the goals of your project. The general requirements for each programming language are listed below. For specific cases such as with examples or with one of the samples, any additional steps required are listed in that respective section.

C/C++

Base Requirements

The recommended base requirements, meaning what just about everyone planning on using C or C++ to develop applications using Site Server 3.0 should have, are listed below:

P&M Specific Requirements

Programmers can get the interface declarations and UUIDs used to access the P&M COM objects in a couple of ways. The most straightforward way is to run the MIDL compiler on the IDL file that defines the interface and coclass desired. The SDK comes with the necessary IDL files to do this. A complete list of IDL files, type libraries, and their locations is given here.

If you are unfamiliar with this process, here's how to generate the necessary header files to access the ObjCreator COM object:

MIDL objcreator.idl

This would produce two necessary header files, objcreator.h and objcreator_i.c in the standard fashion. Include these files where appropriate. The .h file contains the interface definitions, and the .c file contains the UUID (GUID) definitions.

Java

If you plan on using Java to develop applications that interact with P&M, you should acquire the latest Java SDK-version 2.01. The J++ Java compiler that ships with DevStudio '97 has been superseded by the compiler. Many COM-related improvements exist in this latest SDK release, so it is well worth your time.

In order to access the COM objects exposed by P&M, you need to generate the necessary interface and COM Java classes. This is done using the Java SDK tool JActiveX, with the primary argument being the path to a type library containing the IDL information. For example, to generate the Java classes necessary to access the P&M administrative objects, you need the coclass ObjCreator and its interfaces translated to Java classes. First make sure you have the Java SDK bin directory defined in your PATH, and then run:

JActiveX c:\winnt\system32\objcreator.dll /d c:\myjavaclasses

This would create the class files in subdirectories of "c:\myjavaclasses" in the standard way. Make sure you specify the /d switch, or the classes will be placed below your TrustedLib directory.

Check here for a complete list of all type library locations for the COM objects used in P&M.

Visual Basic 5.0

Most of the P&M COM objects implement pure dual interfaces. Since all dual interfaces are intended to contain only oleautomation types, VB 5.0 can use the corresponding type library to bind to the COM interface directly. In order to access P&M COM objects through their COM interfaces, you need to add references (under Project/References) to each of the respective type libraries. If you plan on using just the IDispatch interfaces (using CreateObject to fetch interfaces on COM objects), no references are required.

So, for vtable binding:

add a reference to the appropriate type library

  1. Dim all variables that will hold interfaces on the objects as the appropriate type.

For example, when creating an instance of the AuoConfig admin COM object, you would first need to create an instance of the ObjCreator object, and bind to its IObjCreator COM interface. This would then be followed by the creation of an AuoConfig object with the IAuoConfig interface being returned by the ObjCreator object through the CreateObjAuth method. The steps in VB 5.0 for this would be:

  1. For ObjCreator: add the reference to the Site Server 3.0 Search Authentication Client Type Library 1.0

  2. For IAuoConfig: Add the reference to the AUO Type Library 1.0

  3. Dim the objects according to their target types as follows:

   Dim oObjCreator as ObjCreator   ' only works if Type Lib is referenced

   Set oObjCreator = new ObjCreator   ' instance, returns IObjCreator

   Dim oAuoConfig as AuoConfig

   Set oAuoConfig = oObjCreator.CreateObjAuth("MemAdmin.AuoConfig","")

'  go on to use the AuoConfig object

A complete list of the type libraries that can be used to reference type information for all P&M interfaces is available here.

Scripting Languages (Automation)

For automation enabled scripting languages such as VBScript and JavaScript, little extra information is needed to access the COM objects. In some cases, you may want to prepare a list of constant definitions with human readable names to make error identification easier.

In general, to access the functionality of COM Automation compliant objects, simply create the object using the syntax of the particular language:

VBScript using Windows Scripting Host (WSH) Dim oObjCreator

Dim oAuoConfig

Set oObjCreator = CreateObject("objcreator.objcreator.1")

Set oAuoConfig = oObjCreator.CreateObjAuth("MemAdmin.AuoConfig")

...

JScript using Windows Scripting Host (WSH) var oObjCreator = new ActiveXObject("objcreator.objcreator.1");

var oAuoConfig = oObjCreator.CreateObjAuth("MemAdmin.AuoConfig.1");    


Note that the ASP scripting context provides a separate set of intrinsic objects and nothing more.


© 1997-1998 Microsoft Corporation. All rights reserved.