Title: Visual Basic Calculator Example
Entry Number: << NEXTANSWERENTRYNUMBER >>
Creation Date: << CREATIONDATE >>
Last Updated: << DATE anything >>
Visual Basic Calculator Example
VBCalc.tar contains the source code for the Visual Basic calculator described in the D'OLE Developer's Guide. This example comes in two parts: the client portion, which is written in Visual Basic, and the server portion, which is written in Objective-C. Both portions of the example can be run on the same Windows NT machine. Alternatively, you can run the server code on any machine on your network that is running either OPENSTEP 4.0 or D'OLE 4.0.
Installing the Example
1) Create a directory on your Windows NT machine for the example. Open a Bourne shell window, and make this directory current.
2) Extract the contents of the tar file using gnutar. Assuming that the tar file resides in c:/temp and that you want to install the example into the current directory, the following command will work:
gnutar -xvf c:/temp/VBCalc.tar
3) Compile the server from your Bourne shell window by changing to the Server directory (this is a subdirectory of the current directory) and typing the following:
gcc -g -o Calc Calc.m -framework Foundation
Running the Example
1) Start the server from within the Server directory with the following command:
2) Start Visual Basic on your Windows NT machine, and open the file Calc.mak which is located in the directory into which you extracted the tar file.
3) Edit Form.Load in Calc.frm and change server name in the server.connectTo line to identify your Windows NT machine.
4) Press the F5 key, or select Start from the Visual Basic Run menu.
You can also experiment with this same example running over a network by copying the contents of the Server subdirectory to any machine that is running OPENSTEP 4.0 or D'OLE 4.0 and recompiling it there. Note that on Mach-based computers you compile the server using cc, as follows:
cc -g -o Calc Calc.m -framework Foundation
Be sure that the server is running and that the Load procedure in Calc.frm correctly identifies the machine on which the server is running.
For troubleshooting tips, complete source code, and a discussion on how this example is put together, see the D'OLE Developer's Guide.
You may freely copy, distribute, and reuse the code in this example.
NeXT disclaims any warranty of any kind, expressed or implied, as
to its fitness for any particular use.
NeXT, the NeXT logo, PDO, and D'OLE are trademarks of NeXT Software, Inc.
Visual C++ and Visual Basic are trademarks of Microsoft Corp.