次の方法で共有


Using Remote Automation

In typical Automation scenarios, both the client and the server are on a single computer and share the same resources, such as memory and processor.

Automation on a single computer

When you create local servers for Automation, you can deploy them remotely. Remote Automation allows you the same flexibility, extensibility, and power of local Automation, but over a network. Remote Automation allows:

  • Servers to use separate resources.
  • Many different users to access the same server.

You can configure a server and local computer for remote Automation with the Remote Automation Connection Manager, which saves the settings in the registry. The Automation Manager running on the server computer manages the Automation so that the same code that manipulates a local object can automatically manipulate a remote object.

Remote automation

Configuring the Server

The first step in enabling remote Automation is to configure the server computer for client access in the Remote Automation Connection Manager.

To configure the remote automation server

  1. Copy the Automation server executable file (.exe) to the server and run it one time to register it in the Windows Registry.
  2. On the server computer, run Racmgr32.exe, the Remote Automation Connection Manager.
  3. Select your class in the COM Classes list.
  4. In the Client Access tab, choose Allow Remote Creates by Key.
  5. In the Client Access tab, make sure Allow Remote Activation is selected.

After you've enabled client access in the Remote Automation Connection Manager, run the Automation Manager, Autmgr32.exe, on the server computer. Autmgr32.exe is installed in the System folder or in the System32 folder, depending on your operating system. This will enable remote automation connections from other computers.

Configuring the Client

When the server computer is set up, you can configure the local client computer.

To configure the local computer for remote automation

  1. Copy the .vbr file that was created when you created the Automation server to the client machine.

  2. Run CLIREG32 with the name of the .vbr file. For example, if the file is Myserver.vbr, run the following command at the Command prompt:

    CLIREG32 MYSERVER.VBR
    
  3. In the dialog box that opens, enter the network address of the server machine and choose the network protocol (usually TCP/IP).

System Security Policy Options

The following table describes the System Security Policy area options in the Client Access tab of the Remote Automation Connection Manager.

Name Value1 Description
Disallow All Remote Creates 0 Do not allow any objects to be created.
Allow Remote Creates by Key 2 An object can be created only if the Allow Remote Activation check box is selected. This alters its CLSID in the Windows Registry to include the following subkey setting: AllowRemoteActivation = Y
Allow Remote Creates by ACL 3 A user can create an object only if the Access Control List for the CLSID in the Windows Registry includes the user. Windows NT 4.0 or later only.
Allow All Remote Creates 1 Allow any object to be created. Not recommended outside the development environment.

1. The Value column lists the RemoteActivationPolicy preference setting of the Automation Manager in the Windows Registry.

Using Authentication in Remote Automation

For remote Automation servers running on any Windows operating system, remote call procedure (RPC) provides the following levels of authentication.

Name Value Description
Default 0 Use Network default.
None 1 No authentication.
Connect 2 Connection to the server is authenticated.
Call 3 Authenticates only at the beginning of each remote procedure call, when the server receives the request. Does not apply to connection-based protocol sequences (those that start with the prefix "ncacn").
Packet 4 Verifies that all data received is from the expected client.
Packet Integrity 5 Verifies that none of the data transferred between client and server has been modified.
Packet Privacy 6 Verifies all previous levels and encrypts the argument values of each remote procedure call.

The need for RPC authentication should be evaluated carefully, because as the level of RPC authentication increases, performance declines. You can specify an authentication level for each class in your Automation server, so that costly levels like encryption need not be applied to the entire component.

For example, a data service implemented as a remote Automation server might have a Logon class used to transmit user and password information, and this class might require Packet Privacy authentication. Other classes exposed by the server might use a much lower level of authentication.

Troubleshooting Remote Automation

Here are some suggestions in case you run into difficulties.

Problem Action
OLE error code 0x800706d9: There are no more endpoints available from the endpoint manager. Make sure the Automation manager is running on the server computer and that the name of the server computer is correctly entered in the Network Address box of the Remote Automation Connection Manager.
Visual FoxPro: Application doesn't appear in the Remote Automation Manager OLE Classes list.
  1. Run Regedit.exe to open the registry.
  2. Delete all references to Microsoft Visual FoxPro.
  3. Run Visual FoxPro with the -r command line tag:

    Vfp7.exe -r

See Also

Creating Automation Servers | The Control of Visual FoxPro from Other Applications | Adding OLE | The Subclassing of Objects | Using ActiveX Controls