Distributed COM does it all for you. You don’t have to change a single line of your Python code. All you need is to enable a few settings on the server (which are not specific to this application, but to DCOM in general) and to change one line in the client code. Here are the steps:
DCOM needs to be enabled on the remote server. Choose Start →
Run and type
dcomcnfg.exe. A configuration dialog
starts up. Select the Default Properties tab and check the box for
Enable Distributed COM on this computer.
Python and PythonWin should be installed properly on the server, and the Doubletalk COM server should be registered.
In our Visual Basic program, go to the line of code where we create
BookServer, and add a parameter for the remote
machine name. We added an extra box in the Options dialog, the
contents of which are stored in the variable
RemoteMachine. Here’s the startup
Set BookServer = CreateObject("Doubletalk.BookServer",
If the string
RemoteMachine is empty, the
local server starts up. Otherwise, DCOM talks to the remote machine,
BookServer starts up there. All calls to
the COM object and any return values (including large arrays of data)
are automatically packaged and transported across the network.
To demonstrate this, we created a data file called remotedata.dtj on a machine called yosemite and ran the client on a different machine. In the Options box input the name yosemite and hit the Reload button. At this point, the COM server starts on the ...