PRODUCT : C++ NUMBER : 806 VERSION : All OS : DOS DATE : October 19, 1993 PAGE : 1/5 TITLE : Using Borland C++ and Turbo C++ on a Network Although Borland C++ and Turbo C++ are not intended to be used from a network, it is possible to set them up that way. Most conflicts arise because Borland compilers need to create swap files and configuration files. But, before getting into what you need to do to set up the compiler to be run on a network, a little background terminology and related information will help you understand what is going on. The directory from which you start BC.EXE or TC.EXE is known as the startup directory. The directory in which the BC.EXE or TC.EXE executable is stored is known as the base directory. This is usually the BIN directory of your Borland compiler. The current directory is just what it sounds like--the directory that you are currently in. You can change your current directory with File | Change Dir, and you can find out your current directory with Compile | Information (or File | Get Info with some earlier versions). Note that right after you start up the compiler, your startup directory is also the same as your current directory. Also note that there exists a current directory for each drive on our machine. For example, \BORLANDC\BIN might be the current directory for your C: drive, but \WORK might be the current directory for your A: drive. Finally, in this document the Integrated Development Environment is abbreviated as "IDE," and the command-line compiler is abbreviated as "CLC." With that, we can now follow the steps to running Borland compilers from a network: 0. Single-User Situation If you have multiple users, skip to step 1. For single-user situations, using BC++ or TC++ on a network should be rather straightforward. Simply install the compiler on the desired network drive and make certain that the user has write access to the base directory. If, for some reason, that user should not be allowed to have write access to that directory, you will need to pretend that you have a multi-user situation and follow the steps below. More issues are involved when you want to allow multiple users to run a single copy of the compiler that exists on a network. PRODUCT : C++ NUMBER : 806 VERSION : All OS : DOS DATE : October 19, 1993 PAGE : 2/5 TITLE : Using Borland C++ and Turbo C++ on a Network 1. Running DPMIINST.EXE If you have Borland C++ 2.0 and you plan to use BCX.EXE, follow the instructions below for DPMIINST, but substitute TKINST.EXE whenever you see DPMIINST.EXE. (If you have BC++ 2.0 and you only plan to use BC.EXE, skip to step 2.) If you have any other compiler version earlier than 3.0, DPMIINST is unnecessary, so skip to step 2. If you have a compiler version 3.0 or later, you will want to follow this step to ensure that every machine on your network will work with the compiler. DPMIINST.EXE is a program in the BIN directory of your compiler that runs a series of tests on your machine to figure out the best way to enable protected mode on that particular machine. Also in the BIN directory is DPMI16BI.OVL, a database that contains specific information for many different kinds of machines. If your machine is not in this database, you will receive a message such as "machine not in database -- run DPMIINST" upon execution of the compiler. This database has room for 20 machines that are not already in the database. If you have a lab with more than 20 different makes and/or models, you will receive an error message that says the database table is full. It will not hurt to run DPMIINST, so to be safe, you should run the program on all machines on your network that will be running a compiler version 3.0 or later. Important: The DPMI16BI.OVL file is updated each time a machine that runs DPMIINST cannot be found in the database. Because of this, the network administrator must ensure that any machine running DPMIINST has write access to the directory in which the DPMI16BI.OVL file is stored (usually the base directory). After DPMIINST has successfully run on each machine on the network that will run the compiler, read only access may be restored to the base directory. Note: The DPMI16BI.OVL file must be in your current directory when you run DPMIINST.EXE. If it is not, you will see DPMIINST: cannot find DPMI16BI file: DPMI16BI.OVL 1a. Trouble Running DPMIINST If you are having trouble running DPMIINST on your machines, read this section to find out how to get more help on running DPMIINST. If you have a compiler version 3.1 or later, see the booklet called "Installing and Configuring Borland C++" that was included with your product. If this booklet is missing or if you have a version earlier than 3.1, this booklet is also available PRODUCT : C++ NUMBER : 806 VERSION : All OS : DOS DATE : October 19, 1993 PAGE : 3/5 TITLE : Using Borland C++ and Turbo C++ on a Network as a Technical Information document from Borland. (See the following section for information on how to get the document.) Once you obtain this document, follow the instructions for Booting Clean then for Running DPMIINST.EXE. Here's how to get the document if you don't have it: 1) By FAX: With your touch-tone telephone, call TechFax at 800-822-4269 (only available in the United States). An automated voice will ask you for the document number that you want. The one you want is 1010. You will then be prompted to punch in your fax number. After you do so, one of Borland's automatic fax servers will fax the document to your fax machine within about half an hour. (For future reference, you can also order a catalog of all the documents available from TechFax. The automated voice will tell you how to do so.) Our TechFax service is available to you 24 hours a day, free of charge. 2) By MODEM: Call our bulletin board service (BBS) at 408-439-9096. The settings are 8N1 at up to 9600 baud. When you log on, choose Languages, then Borland C/C++, then Technical Information Documents. Download file TI1010.ZIP in binary mode. After receiving the file on your machine, unzip the file with the UNZIP.EXE utility in the BIN directory of your compiler. Our BBS is available to you 24 hours a day, and there is no additional charge to use this service beyond the charges that you incur for the phone call. 2. Eliminate swap file contention By default, for all compiler versions, swap files will be created in the startup directory. These swap files are unique to any given session of BC.EXE or TC.EXE. Multiple users must be prevented from creating swap files in the same directory because the compiler cannot sort out which user is using which swap file. Note that if you change directories inside the IDE using File | Change Dir, the location of the swap file will not change; it will continue to be placed in the startup directory. If you have a compiler version 3.0 or later, you may use the /r option with BC.EXE or TC.EXE. This option indicates what drive the swap file should be written to. Rather than creating the swap file in the startup directory, it will be created in the current directory of the drive that you specify with the /r option. For example, if you start up Borland C++ with BC /rc, the swap files will be created on the current directory of the C: PRODUCT : C++ NUMBER : 806 VERSION : All OS : DOS DATE : October 19, 1993 PAGE : 4/5 TITLE : Using Borland C++ and Turbo C++ on a Network drive. Using the /r option allows you to start the compiler in any directory and still have control over where the swap file gets created. Ideally, you should specify a local hard drive or floppy drive with the /r option as opposed to a network drive, to which other users may have access. A /r option exists in TC++ 1.01 and BC++ 2.0, but it works for other swapping issues and will not allow you to specify where your swap file will be created. The /r option only allows you to specify the swap file location in the 3.0 or later versions of our compilers. To eliminate swap file contention with compiler versions earlier than 3.0, you must ensure that each user starts up in a directory to which they have write access and to which no one else has write access. This directory could be on a local floppy drive, or on a local hard drive, or it could even be a directory on a network drive, as long as the conditions of unique access are met. 3. Eliminate configuration file contention Borland compilers use different configuration files depending upon whether you are using the IDE or CLC. These files are: IDE: TCCONFIG.TC, TCDEF.DPR, and TCDEF.DSK CLC: TURBOC.CFG and TLINK.CFG They can be located in the current directory or in the base directory or both. It is also possible for them to exist in neither of those directories. Since it is preferred that each user should have control over his or her own configuration settings, you will need to eliminate configuration file contention as well. Here is the algorithm that the compiler uses when it is executed to determine which configuration files to use: 1. Check the current directory. If configuration files exist here, use them. 2. Check the base directory. If configuration files exist here, use them. 3. Create default configuration files in the base directory. PRODUCT : C++ NUMBER : 806 VERSION : All OS : DOS DATE : October 19, 1993 PAGE : 5/5 TITLE : Using Borland C++ and Turbo C++ on a Network Note that if no configuration files exist in the current directory or in the base directory, new ones will be created upon startup in the base directory. So, to avoid configuration file contention, simply copy the appropriate configuration files to a directory to which the user has write access and to which no other user has write access and ensure that the user is in that directory when starting the compiler. As long as these steps are ensured, you can then make the base directory read only. Note, however, that you would probably want to remove any configuration files from the base directory. If configuration files exist there and a user happened to start up in a directory that did not contain configuration files, everything would appear to work fine until the configuration files were saved. At that point, they will likely get a "cannot create configuration file" error and will be forced to exit without being able to save their configuration. ------------------------------------------------------------ These guidelines have been compiled and made available as a courtesy of Borland Technical Support. We know that if you follow these guidelines, you may be able to get your network installation to perform as you expect. However, because of the complexities of networks and the many potential problems that may ensue, we cannot guarantee that these guidelines will work for everyone. DISCLAIMER: You have the right to use this technical information subject to the terms of the No-Nonsense License Statement that you received with the Borland product to which this information pertains.