Version 8.0
 —  DCOM  —

EntireX DCOM Examples

This document covers the following topics:


Introduction

The distribution kit for EntireX DCOM contains a variety of examples for demonstrating product functionality. The examples for UNIX are in the UNIX kit; the same sources but with Windows makefiles and MSDEV Workspaces/Projects are in the Windows Installation.

EntireX DCOM delivers a basic set of advanced Distributed COM features on UNIX, Midrange and Mainframe systems.

We have created two classes of samples for EntireX DCOM. This is to give you the possibility to verify your installation and to give you a head start on DCOM.

The basic RPC example is mainly to verify the installation process for the RPC runtime piece of EntireX DCOM. It is a simple application that is interoperable with an example as shipped by Microsoft with the WIN32 SDK on Windows.

The DCOM examples cover some features (both basic ones and more sophisticated types) of the distributed object mechanisms as provided by EntireX DCOM. In addition there are pre-built images for Windows (Intel) of a particular sample that can be used to verify the installation of the DCOM piece of this kit. Review the detailed instructions and learn how to run the verification and interoperability test.

These samples work both locally with the EntireX DCOM implementation as provided by Software AG and remotely with DCOM on Windows. In addition, the forthcoming versions of EntireX DCOM on various platforms will be interoperable with these samples.

Note:
These samples are provided to you "as is" and without warranty of any kind, expressed or implied, including but not limited to, warranties of performance, merchantability, or fitness for a particular purpose. User bears all risk as to the quality and performance of the software and as such neither the author, nor Software AG shall be held liable for any loss of data, down time, loss of revenue or any other direct or indirect damage or claims caused by these programs.

Top of page

Summary of Sample Applications

There is a whole series of distributed object applications delivered with Software AG's EntireX DCOM. We have tried to cover all of the major aspects of DCOM that are supported by EntireX DCOM. However, the set of applications is far from being complete in the sense that we show how to use all of the features of EntireX DCOM. The idea is to provide a framework of applications that demonstrate the use of DCOM and that can be used to write your own applications. We recommend that you build and run the applications and browse the sources in addition to get a better understanding of DCOM in general and of EntireX DCOM in particular.

Some of the samples are UNIX ports of DCOM applications that are available from Microsoft's COM and DCOM developer page. Others are new and have been written without an existing Windows source. We provide samples that operate locally only, as well as applications that use DCOM to communicate over the network. Use of C and C++ is demonstrated as well as interoperability with Visual Basic applications. Most of the samples can be compiled and built on Windows as well, but it is not the intent of these applications to demonstrate portability of DCOM source code across various platforms. This distribution contains source code that is customized to support EntireX DCOM from Software AG.

Check the EntireX DCOM documentation for details and review the Microsoft documentation to get information on how to migrate the samples to Windows and how to write native DCOM applications for Windows. The sample source code contains the necessary files that are required to build the application with the exception of the public header files that come with EntireX DCOM. You should be able to build these applications on all target platforms. Take a look at the sources and at the makefiles for the various platforms for detailed information.

In general the EntireX DCOM samples share a common structure.

Top of page

Hello RPC Application

The RPC HELLO program is a client/server implementation of the classic "Hello, world" program. It is mainly used to verify the installation process.

It is a simple application that is interoperable with an example as shipped by Microsoft with the WIN32 SDK and with the Visual C++ compiler. Check out the documentation within the WIN32 SDK for more information on how to build this application on Windows.

The port contains the necessary files that are required to build the application with the exception of the public header files that come with EntireX DCOM. The application that can be built here should be interoperable with the one that comes with the Microsoft SDK (see above). You can build both the hello and the whello (a wide-character version of hello).

This example application can be used to:

To build the UNIX application - and to verify the installation - it is sufficient to do the following:

  1. Use the make utility (see the documentation or man pages e.g. man make). Make should start the MIDL (Microsoft Interface Definition Language) compiler, which in turn generates C sources and a header file. The next step of the make process is to generate a client (helloc) and a server (hellos) application for testing.

  2. Although this very basic example only uses plain Microsoft RPC, it also requires correct security settings which are applicable to both DCOM and Microsoft RPC. If you are using local authentication (paulad -local), make sure that the user who starts the example program has an entry in the $EXXDIR/$EXXVERS/etc/ntpasswd.txt file (use ntpasswd uid to add an entry). If you are using domain controller authentication (paulad -rpc) the user must have a valid, enabled account on the domain controller (see EntireX DCOM Security for information on how to set this up).

  3. Then run the RPC tests locally on the UNIX machine. First enter hellos to start the server process. Hellos will register with the RPC runtime component of EntireX DCOM and wait for a client application to request a service. Then (in a different terminal window) enter helloc to activate the client application. Helloc tries to get in contact with hellos and then activates the advertised service. Both hellos and helloc will print some information on their state to standard output (usually the controlling terminal), so you can follow the client/server interaction.

  4. Running hellos or helloc against a remote (Windows) partner requires additional command-line arguments. Try the -help command-line switch for exact names.

  5. If you want to generate the wide-character version, you have to edit the makefiles and enable the compiler flag TEST_WCS.

Top of page

Simple C COM Application (simplec)

Summary

The SIMPLE_C sample is a C version of the SIMPLE application. It provides the identical functionality and it uses the same interface and class definition (only differs in CLSID and names). So, with this sample and the matching C++ version, you can see how to mix C and C++ in your applications. The purpose of this sample is to demonstrate the use of COM from the C programming language.

Files and Directories

Name Description
client/simple_c.c client application (container) for the simple in-process server
inproc/printstr_c.c simple "print-string" in-process server
inproc/printstr_c.def definition file for the inproc server shared library
common/iprint.h include file with the CLSID definition of the interface

Start of instruction setTo build all components

Start of instruction setTo run the application

  1. Register the generated inproc server shared library by importing the registry information with the command make register.

  2. Start the simple_c executable (make sure to follow the shell quoting rules for the command argument)

Top of page

Simple C++ COM Application (simple)

Summary

The SIMPLE sample is a very basic in-process server implemented in a shared library called libprintstr.so. It provides the well-known "Hello World" example as a COM in-process server. The purpose of this sample is to illustrate the minimum required to implement an object that can be used by clients for in-process activation. This in-process component can also be used in a surrogate process either on the local machine or on a remote machine.

Files and Directories

Name Description
client/simple.cxx client application (container) for the simple inproc server
inproc/printstr.cxx simple "print-string" in-process server
inproc/printstr.def definition file for the inproc server shared library
proxy/simple.idl interface definition file for the Simple example
proxy/printps.def definition file for the proxy/stub library

Start of instruction setTo build all components

Start of instruction setTo run the application

  1. Register the generated inproc server shared library and the proxy/stub library by importing the registry information with make register.

  2. Start the simple executable (make sure to follow the shell quoting rules for the command argument)

The client application will print some information on its state to standard output (usually the controlling terminal), so you can follow the in-process server activation and interaction. If you use the surrogate option, the surrogate process dllhost will be launched and will print the text.

This example is also availabe with Microsoft Visual Studio workspace on Windows.

Top of page

Microsoft C++ Simple DCOM Application (mssimple)

Summary

The MSSIMPLE program is a simple DCOM application that is able to perform local (out-of-process) as well as remote activation. This application implements the SimpleObject class as a LocalServer. Instances of this class support a limited form of the IStream interface. Calls to IStream::Read and IStream::Write will "succeed" (they do nothing), calls on any other methods fail with _NOTIMPL. The purpose of this sample is to demonstrate what is minimally required to implement an object that can be used by clients (both those on the same machine using COM and those using DCOM across the network). The initial version of this software was published by Microsoft with the first beta version of DCOM for Windows 95. It was operable on Windows NT (4.0) and Windows 95 at that time; this distribution contains source code that has been modified to support EntireX DCOM from Software AG. You should be able to build this application on all target platforms. Take a look at the sources and at the makefiles for the various platforms for detailed information.

Make sure you are familiar with the DCOM configuration on your machine and read the hints we give for migrating sources to Windows if you want to use this sample for cross-platform tests (see Remote Activation).

Files and Directories

Name Description
client/sclient.cxx client application (container) for the out-of-process server
server/sserver.cxx server application code

Start of instruction setTo build all components

Start of instruction setTo run the application

  1. You can register the generated server application with the command make register or you can invoke the server application directly with the -regserver command option. By default the server executable is generated into the $EXXDIR/$EXXVERS/examples/bin directory. You can unregister the server with the -unregserver command option.

  2. There is NO proxy/stub shared library that has to be registered for this application, since it uses a standard COM interface.

  3. Start the server (sserver) with the -embedding option, if you want to have a pre-started server.

  4. Start the client (sclient) executable (be sure to follow the shell quoting rules for the command argument)

Remote Activation

If you want remote activation of this example, refer to how to build the Windows version of a sample.

Top of page

Basic C++ DCOM Application

Summary

The BASIC application is a set of DCOM programs and libraries that cover all aspects of server activation (in-process, out-of-process local and remote). The application implements the CReadOnly and CReadWrite classes as a LocalServer and as an InProcServer. Instances of these classes support calls to IReader and IWriter interfaces. The purpose of this sample is to demonstrate the minimum requirement to implement an object that can be used by clients for in-process and out-of-process activation (either on the same machine or remotely across the network) using non-standard interfaces.

Files and Directories

Name Description
proxy/basic.idl interface definition for the Basic example
proxy/basicps.def definition file for the proxy/stub library
inproc/basic.def definition file for the inproc server shared library
client/basicl.cxx client application (container) for the in-process and out-of-process server.
server/basicsvc.cxx out-of-process and in-process server application code
server/cf.cxx class factory for out-of-process and in-process server
server/cf.h definition of class factory C++ class
server/basicobjs.cxx implementation of CReadOnly and CReadWrite C++ classes
server/baseobjs.h definition of CReadOnly and CReadWrite C++ classes
common/resource.h commonly used header file with definitions from the Microsoft Developers Studio
common/string816.h commonly used header file with definitions of some Unicode to MBCS/ANSI translation classes

Start of instruction setTo build all components

Start of instruction setTo run the application

  1. Register the generated proxy/stub shared library (libbasicps.so) and the in-process server (libbasicsvc.so) with the command make register or use the regsvr utility that is provided with EntireX DCOM.

  2. Register the out-of-process server with the command make register or by starting the server directly with the -r[egserver] command option. This will make all the necessary entries in the registry to allow an activation of this server by the DCOM runtime process (namely RPCSS). To unregister the server again, use the -u[nregserver] command option.

  3. Start the server with the -e[mbedding] option if you want to have a pre-started server.

  4. Start the basiccl executable (make sure to follow the shell quoting rules for the command argument)

Remote Activation

If you want remote activation of this example, refer to how to build the Windows version of a sample.

Top of page

Car Rental Visual Basic DCOM Application

Summary

The Car RENTAL application is a DCOM sample with a Visual Basic client on Windows and a server on the UNIX side. It is a simplified car rental system. The server delivers all necessary data about the cars except for some photographs of them, which are located on the client side in bitmap format. The purpose of this sample is to demonstrate how a Visual Basic client can talk with a C++ server on UNIX.

Make sure you are familiar with the DCOM configuration on your machine and read the hints we give for how to build the Windows version of a sample if you want to use this sample for cross-platform tests.

Files and Directories

Filename Platform Comment
clerk/main.cpp UNIX main routine which contains the data and the code for registering/un-registering.
clerk/cf.cpp UNIX implements the class factory.
clerk/clerksrv.cpp UNIX implements the IRentalClerk interface and the class CRentalClerk.
clerk/clerksrv.h UNIX include file for the Clerk Server
proxy/clerksrv.idl UNIX interface definition for the rental demo

Start of instruction setTo build all components on UNIX

Start of instruction setTo run the application

  1. Register the server with the command make register or with clerksrv -r[egserver] on UNIX. The procedure is the same on Windows. You can later unregister the server with clerksrv -u[nregserver]

  2. Pre-start the server with clerksrv if you do not want to use the launch capabilities of rpcss.

  3. Using DCOM config (select Run on the Start menu then type dcomcnfg), set the remote host name of the SAG Rental Clerk server to the hostname or IP address of your server machine.

  4. Start the rental client on Windows (rental.exe).

Top of page

Active Template Library 3.0 Application 1 (atltest3)

Summary

The Active Template Library (ATL) was created to provide developers with a convenient mechanism for building lightweight and fast COM (Component Object Model) objects. COM is the technical underpinning of all Microsoft ActiveX technologies. The ATL sample suite is a client/server application that shows the use of the ATL sources that have been ported as part of EntireX DCOM. It operates both locally as well as remotely.

Files and Directories

Name Description
proxy/atltest3.idl interface definition of AtlTest3
proxy/atltest3ps.def definition file for the proxy/stub library
client/atltest3.cpp client side test application for the ATL code
server/atlinc.cpp source file that includes the Microsoft ATL template code
server/atltest3_s.cpp source file with the main server code
server/atltest.h header file with the class definition for the test module
server/atltest3_rc.cpp C++ version of Windows resource file
server/resource.h header file with definitions from the Microsoft Developers Studio
makefile makefile as input for the make utility

Start of instruction setTo build all components

Start of instruction setTo run the application

  1. Register the generated proxy/stub shared library libatltest3ps.so and the test server atltest3_s with the command make register. As an alternative you can use the regsvr utility that is provided with EntireX DCOM to register the proxy/stub shared library libatltest3ps.so.

  2. Register the out-of-process server by starting the server with the -regserver command option (this is automatically done with the command make as well). This will make all the necessary entries into the registry to allow an activation of this server by the DCOM runtime. To unregister the server again, use the -unregserver command option.

  3. Start the server (atltest3_s) with the -embedding option, if you want to have a pre-started server.

  4. Start the atltest3 executable (make sure to follow the shell quoting rules for the command argument).

To run the test between Windows and your EntireX DCOM platform, register the proxy/stub dll on Windows with regsvr32 <library name> and the server with atltest3_s -r.

Both the client application and the server application will print some information on their state to standard output (usually the controlling terminal), so you can follow the server activation and interaction.

Remote Activation

If you want remote activation of this example, refer to how to build the Windows version of a sample.

Top of page

Active Template Library 3.0 Application 2 (labrador)

Summary

The Active Template Library (ATL) was created to provide developers with a convenient mechanism for building lightweight and fast COM (Component Object Model) objects. COM is the technical underpinning of all Microsoft ActiveX technologies. The Labrador sample is a client/server application that shows the use of the ATL 3.0 sources that have been ported as part of EntireX DCOM. It operates both locally and remotely.

Files and Directories

Name Description
proxy/labrador.idl Interface definition of Labrador Object
proxy/labps.def Definition file for the proxy/stub Library
client/labdriv.cpp Client side test application for the ATL 3.0 code
client/prelabdr.cpp Source file that includes the file with IIDs of the interfaces supported
client/prelabdr.h Include file for standard and project specific include files changed infrequently
server/labrador.cpp Source file with the main server code
server/labobj.h Declaration of the CLabrador class
server/prelab.h Include file for standard and project specific include files changed infrequently
server/prelab.cpp Source file that includes the ATL Implementation File
server/labrador_rc.cpp C++ version of Windows resource file
server/labres.h Header file with definitions from the Microsoft Developers Studio
makefile Makefile as input for the make utility

Start of instruction setTo build all components

Start of instruction setTo run the application

  1. Register the generated proxy/stub shared library liblabps.so and the test server (labrador) with the command make register. As an alternative you can use the regsvr utility that is provided with EntireX DCOM to register the proxy/stub shared library liblabps.so.

  2. Register the out-of-process server by starting the server with the -regserver command option (this is automatically done with the command make register as well). This will make all the necessary entries into the registry to allow an activation of this server by the DCOM runtime (namely RPCSS). To unregister the server again, use the -unregserver command option.

  3. Start the server (labrador) with the -embedding option, if you want to have a pre-started server.

  4. Start the labdriv executable (make sure to follow the shell quoting rules for the command argument).

To run the test between Windows and your EntireX DCOM platform, register the proxy/stub dll on Windows with regsvr32 <library name>; for local tests on Windows, register the server with labrador -r as well.

Both the client application and the server application will print information on their state to standard output (usually the controlling terminal), so you can follow the server activation and interaction.

Remote Activation

If you want remote activation of this example, refer to how to build the Windows version of a sample.

Top of page

Structured Storage Application (stgtest)

Summary

The STGTEST program is a simple COM application that creates a structured storage document file TEST.DFL with substorages and streams. It then performs miscellaneous tests using IStorage and IStream interface methods. It does not fall into the category of client/server sample applications and therefore does not use the standard directory layout with client, server and prox/stub components.

Once you have created the document file you can use the stgview utility that is part of the EntireX DCOM distribution to view the contents of the generated document file.

Files and Directories

Name Description
stgtest.cxx Sample application that creates the structured storage document.

Start of instruction setTo build all components

Start of instruction setTo run the application

This application does not produce significant output. The appeal of this sample is more in the area of source code browsing than presenting COM features at runtime.

Top of page

Beer C++ DCOM Server Application

Summary

The BEER application is a DCOM program and library that demonstrates the use of monikers. The server can be activated through a file moniker which points to the specified file.

The client activates an object via a File Moniker and the object loads its persistent state out of the file.

There is an additional client application for this server that implements a dual interface client.

Files and Directories

Name Description
beer_mon This is the file moniker client.
beer_oa This is the dual interface client
server/beer.cxx Out-of-process server application code
server/copoint.cxx Contains the implementation of CoPoint C++ class
server/copoint.h Definition of CoPoint C++ class
common/clsids.h Definition of the CLSIDs

Start of instruction setTo build all components

To build this example on Windows, refer to how to build the Windows version of a sample.

Start of instruction setTo run the application

  1. Register the generated proxy/stub shared library libbeerps.so with the regsvr utility that is provided with EntireX DCOM or register it with the make register command.

  2. Register the server with beer -regserver in the registry. You can later unregister the server with beer -unregserver. You can also register the server with the make regserver command. This will also register the generated type library ipoint.tlb.

  3. Start the server with beer -embedding if you want to run the server in interactive mode. If the server is not pre-started, it will be launched automatically when the client wants to bind to the object.

  4. On Windows, register the proxy/stub dll with regsvr32 <library name> and the server with beer -r.

  5. Decide on one of the client applications to run

Both the client application and the server application will print some information on their state to standard output (usually the controlling terminal), so you can follow the server activation and interaction.

File Moniker Application

Summary

The BEER_MON application is a client for the beer server sample. It demonstrates the use of file monikers. The purpose of this example is to show how a server can be launched using the file's extension and how an object can be instantiated via a file moniker. The client activates an object using a file (file moniker which points to the specified file) and the object loads its persistent state out of the file. The default file extension (.bar) must be a key in the registry and it contains the CLSID of the object. The file contains two long values which represent the co-ordinates of a point. To start the example it is sufficient that the file contains 8 bytes, representing the two long values. After the first time, the server automatically converts the file into a storage file. You can also see how the client can set new values for the point co-ordinates and how this state of the object can be saved to the file and loaded at a later point in time.

Files and Directories

Name Description
beer_mon.cxx This is the moniker client.
foo.bar sample file with the co-ordinates x=111 and y=222

Start of instruction setTo build all components

Start of instruction setTo run the application

  1. Perform the required registration and activation steps for the server side

  2. Start the beer_mon executable (make sure to follow the shell quoting rules for the command argument)

Both the client application and the server application will print some information on their state to standard output (usually the controlling terminal), so you can follow the server activation and interaction.

ActivateAtStorage

  1. Build the proxy/stub dll, the type library and the beer_mon client on Windows as described in the section on how to build the Windows version of a sample (see Remote Activation).

  2. Register the proxy/stub dll.

  3. Import the file beer_nt.reg to your Windows registry.

  4. You must mount the UNIX file system on Windows (e.g using Samba). Then start the beer_mon client as described above where the executable is located on the UNIX file system. You need the file foo.bar in the same directory. You can use the same file as you use for the UNIX example because the structured storage file is binary compatible.

  5. If you use the delivered file foo.bar, be aware that the coordinates will be different because of the different endianness of UNIX and Windows. If you use an already generated file (e.g. after running beer_mon under UNIX with -item) you should also receive the same values on Windows.

Dual Interface DCOM Client Application

Summary

The BEER_OA application is a program that extends the Moniker sample application with a dual interface client. The purpose of this example is to show the implementation of a dual interface.

Files and Directories

Name Description
beer_oa.cxx This is the dual interface client as an extension to the Moniker sample server.

Start of instruction setTo build the client components

Start of instruction setTo run the application

  1. Follow the instructions for the server, as described in the server side of the Moniker sample documentation.

  2. Start the beer_oa executable (make sure to follow the shell quoting rules for the command argument)

Both the client application and the server application will print some information on their state to standard output (usually the controlling terminal), so you can follow the server activation and interaction.

Remote Activation

  1. Build the proxy/stub dll, the type library and the beer_oa client on Windows as described in the section on how to build the Windows version of a sample.

  2. Register the proxy/stub dll.

  3. Import the file beer_nt.reg to your Windows registry (after adjusting the path information).

  4. Start the beer_oa with the additional option -node <node address>.

Top of page

Basic C++ Automation Application (vartypes)

Summary

The VARTYPES application is a set of DCOM programs and libraries that tests the supported variant types. This application implements the CVarTypes class as a LocalServer or RemoteServer. The purpose of this sample is to demonstrate how to use Automation to get access to local or remote objects. The example is implemented as Dual Interface to show all available kinds of invocation.

Files and Directories

Name Description
client/vartest.cxx Automation controller for the objects in the server.
client/fktcalls.cxx source code for the method calls.
client/vartest.h prototypes for the internal functions.
server/vartypes.cxx class factory for out-of-process server and main function
server/typfkt.cxx server application code for the Automation objects
server/typefkt.h definition of C++ class CVarTypes
proxy/vartypes.idl interface definition file

Start of instruction setTo build all components

Start of instruction setTo run the application

  1. Register the out-of-process server with the command make register or by starting the server directly with the -regserver command option. This will make all the necessary entries in the registry to allow an activation of this server by the DCOM runtime (namely RPCSS). To unregister the server again, use the -unregserver command option.

  2. Start the server with the -embedding option, if you want to have a pre-started server.

  3. Start the vartest executable (make sure to follow the shell quoting rules for the command argument)

Both the client application and the server application will print some information on their state to standard output (usually the controlling terminal), so you can follow the server activation and interaction.

Remote Activation

  1. Register the server with vartypes -r.

  2. Start the vartest.exe with the additional option -node <node address>.

Top of page

CoolRot C++ DCOM Application

Summary

The CoolRot application is a DCOM program and library that shows how to use the ROT (Running Object Table). A server is registered in the ROT using a composite Moniker (CoolRot Item Moniker 1 and CoolRot Item Moniker 2) and the client binds the object via this moniker. The application implements the CLSID_CoRot as a LocalServer, instances of this class support calls to SetCoords, GetCoords and Shut interfaces. The purpose of this sample is to demonstrate how a server can register in the ROT using a moniker and how a client, knowing only the CLSID and the moniker name, can bind to the object.

After starting the server rot_s, you can use the irotview utility to see the moniker as it is registered in the ROT.

Files and Directories

Name Description
client/rot_c.cxx client application.
server/rot_s.cxx out-of-process server application code
server/corot.cxx implementation of CoRot C++ class
server/corot.h definition of CoRot C++ class

Start of instruction setTo build all components

Start of instruction setTo run the application

  1. Register the generated proxy/stub shared library libirotps.so with the command make register or with the regsvr utility that is provided with EntireX DCOM.

  2. Register the server with the command make register or with rot_s -regserver in the registry. You can later unregister the server with rot_s -unregserver.

  3. Start the server with rot_s.

  4. Start the rot_c executable (make sure to follow the shell quoting rules for the command argument)

Both the client application and the server application will print some information on their state to standard output (usually the controlling terminal), so you can follow the server activation and interaction.

Top of page

ConnBall DCOM Application

Summary

The ConnBall DCOM application shows how to construct a Connectable DCOM object (ConnBall) in a thread-safe server (conserve) using the DCOM Connection Points. The ConnBall class implements the standard COM interface, IConnectionPointContainer, and it also implements a custom interface (IBall).

The principal focus is the connectable object support in ConnBall and how connected clients are notified of ball events. conserve works with the guiclient text-based client code.

ConnBall implements a virtual moving ball, defining the internal logic of a moving ball that exists within a specified two-dimensional bounding rectangle. ConnBall provides only a description of a ball. Clients move the virtual ball using its IBall interface. ConnBall's internal logic will bounce the ball when it collides with a boundary. The client can obtain the ball's current position, size and color to permit display of the ball's moving image. The client can also use the connection facilities of ConnBall to receive notifications of ball bounce events. The client will use these connection facilities to produce some warnings when the ball bounces.

Files and Directories

Name Description
win_client/* Win32 client application files
vb5cli/* Visual Basic client application files
proxy/iball.idl Interface definition of Ball and Sink Objects
proxy/conserveps.def The module definition file for building the Proxy/Stub Library
client/conclien.cpp The guiclient's main implementation file. It is a text-based C++ program
client/nonguiball.cpp Implementation file for the CNonGuiBall C++ class
client/nonguiball.h The class declaration for the CNonGuiBall C++ class
client/sink.cpp Implementation file for the COBallSink class
client/sink.h The class declaration for the COBallSink class
server/conserve.cpp The main implementation file for conserve. Has DllMain/main and the COM server functions (e.g. DllGetClassObject)
server/conserve.h The include file for declaring as imported or defining as exported the service functions in the InProc version of conserve
server/ball.cpp The implementation file for the COBall object class
server/ball.h The include file for the COBall object class
server/connect.cpp The implementation file for the connection point enumerator, connection point, and connection enumerators objects
server/connect.h The include file for the connection point enumerator, connection point, and connection enumerator classes
server/apputil.cpp Implementation file for the general application utility class CThreaded and some functions (e.g. Message)
server/apputil.h Include file for the general application utility class CThreaded and some functions
server/factory.cpp The implementation file for the server's class factories
server/factory.h The include file for the server's class factory COM objects
server/server.cpp The implementation file for the server control object
server/server.h The include file for the server control C++ object
server/ballguid.h Include file for the ball-related IIDs and CLSIDs
server/conserve.def The module definition file for building the InProc version of the server
outproc/makefile Makefile as input for the make utility in order to build the OutProc version of the server (conserve)
makefile Makefile as input for the make utility

Start of instruction setTo build all components

Start of instruction setTo run the application

  1. Register the generated proxy/stub shared library (libconserveps.so) with the command make register or with the regsvr utility that is provided with EntireX DCOM.

  2. Register the server with the command make register or with conserve -regserver. You can later unregister the server with conserve -unregserver.

  3. If you want to use the in-process version of the server (libconserve.so), register it with the command make register or with the regsvr utility.

  4. Start the server with conserve -embedding option if you want to have a pre-started server. If the server is not pre-started, it will be launched automatically when the client wants to bind to the object.

  5. Start the text-based conclien executable (make sure to follow the shell quoting rules for the command argument)

  6. There are two additional client applications available:

Both the client application and the server application will print some information on their state to standard output (usually the controlling terminal), so you can follow the server activation and interaction.

Remote Activation

If you want remote activation of this example, refer to how to build the Windows version of a sample.

vbconclien Visual Basic Application

Summary

The vbconclien application is a Visual Basic program that creates and uses the ConnBall application housed in the conserve server.

The vbconclien client creates one ConnBall object reference and controls it through the IBall interface that the object exposes, using the generated type library. vbconclien sets up a Timer control to use IBall to periodically move the ball and obtain updates of data describing the ConnBall object's position. It uses that data, obtained by calling the IBall::GetBall method, to display graphical snapshot images of the ball in the client's main window.

In response to the timer's events, vbconclien uses the IBall interface to move and paint images of the ball. ConnBall object also sends events back to vbconclien, using the IBallSink interface, when the ball bounces off of a side of its bounding rectangle. vbconclien responds to these events to produce a sound when the ball collides with a Top, Side, or Bottom boundary of the display frame.

Files and Directories

Name Description
vb5cli/vbconclien.vbp Visual Basic project
vb5cli/*.frx VB form binaries
vb5cli/connball.frm Main window application and code
vb5cli/frmSplash.frm Initial window
vb5cli/frmAbout.frm About dialog

Start of instruction setTo build all components

First of all, build the Proxy/Stub library on your Windows and build the conserve server (and proxy/stub library) on the UNIX machine with EntireX DCOM. Then build vbconclien client with Visual Basic.

Start of instruction setTo run the application