home account info subscribe login search FAQ/help site map contact us


 
Brief Full
 Advanced
      Search
 Search Tips
To access the contents, click the chapter and section titles.

Advanced Visual Basic Techniques
(Publisher: John Wiley & Sons, Inc.)
Author(s): Rod Stephens
ISBN: 0471188816
Publication Date: 06/01/97

Search this book:
 
Previous Table of Contents Next


Install the Server

Installing the server is as simple as copying the executable file onto the server computer. Several Visual Basic and OLE support files must also be copied onto the server computer if it does not have Visual Basic installed.

The easiest way to install these files is to use the Application Setup Wizard. The Wizard should create a distribution kit just as if the server were being shipped to a customer.

In Visual Basic 4, the Setup Wizard provides an OLE service provider check box, as shown in Figure 11.8. Checking this box makes the Setup Wizard include OLE automation support files that the server computer needs.

The Setup Wizard may have a hard time finding all the components it needs to install the server. For example, if it cannot locate the Data Access Object library DAO3032.DLL, the location of this file must be entered into the Wizard manually. These files should be in the subdirectories of the Windows directories (\Windows in Windows 95, \WINNTxx in Windows NT). In Windows 95, these files may be in the subdirectories of \Program Files. If all else fails, the Windows Explorer’s Find utility can search the entire hard disk for the missing files.

Visual Basic 5’s Setup Wizard performs a similar function by asking if the component will be accessed through remote automation, as shown in Figure 11.9. Answering yes to this question makes the Wizard include the necessary automation files.


Figure 11.8  Selecting OLE components in the Visual Basic 4 Setup Wizard.

Register the Server

When a client needs to use the server application, it sends a request to the server computer. Entries in the system registry tell the server computer how to resolve the request.

Creating the proper registry entries is quite complicated. Fortunately, the entries need not be created by hand. If the server is installed using a setup kit created by the Application Setup Wizard, the registry entries are created automatically when the server is installed.

Otherwise, executing the server on the server computer creates the registry entries. The program will start and then stop almost immediately. Before it stops, the program will create the necessary registry entries.

Whenever an updated version of the server is copied onto the server computer, the registry entries must be updated. This can be done by executing the new version of the server.

Grant Server Access

The server computer will not allow external applications to create servers unless they have been given permission. The Remote Automation Connection Manager on the server computer manages server access permissions. This program is called RACMGR32.EXE and is located in the Clisvr subdirectory of the Visual Basic installation directory.

If the server is installed using a setup kit created by the Setup Wizard, and the appropriate OLE options are selected, the installation places RACMGR32.EXE on the server computer. It will be in one of the subdirectories of the Windows directory (\Windows in Windows 95 or \WINNTxx in Windows NT).


Figure 11.9  Selecting OLE components in the Visual Basic 5 Setup Wizard.

When the Remote Automation Connection Manager runs on the server computer, it presents a list of server applications similar to the one shown in Figure 11.10. An entry for the server class should be listed if it was correctly registered, as described in the previous section.

Clicking on the Client Access tab and selecting the Allow All Remote Creates option will let all applications on other computers create instances of server class.

Start the Automation Manager

On the server computer, the Automation Manager AUTMGR32.EXE must be running when the client attempts to use the server. This program is located in the same directory as the Remote Automation Connection Manager.

When it begins, the Automation Manager starts the protocols available on the server computer and then minimizes itself. The Automation Manager should remain running as long as the client may need to access the server.

Register the Server

The Remote Automation Connection Manager on the client computer tells the client computer where to find the server application. Clicking on the server’s entry displays information about the server’s location. In Figure 11.10, for example, the server class TimeManager.TimeSetter is served by the remote computer Beauty using the TCP/IP network protocol. After the appropriate network address and protocol have been entered, the Apply button makes the changes take effect.


Figure 11.10  The Remote Automation Connection Manager.

This gives the client computer the information it needs to locate the remote server, but it does not actually select the server. The Remote command in the Remote Automation Connection Manager’s Register menu selects remote service. The Local command indicates that the computer should use a local server rather than a remote one.

Run the Client

Now the client application can finally be started and tested with the remote server.


Previous Table of Contents Next


Products |  Contact Us |  About Us |  Privacy  |  Ad Info  |  Home

Use of this site is subject to certain Terms & Conditions, Copyright © 1996-1999 EarthWeb Inc.
All rights reserved. Reproduction whole or in part in any form or medium without express written permision of EarthWeb is prohibited.