home *** CD-ROM | disk | FTP | other *** search
- @echo off
- cls
- ECHO ***************************************************************************
- ECHO * SAMPLE PROGRAM: SAMPLE04 -- Dynamically-linked runtime *
- ECHO * *
- ECHO * COPYRIGHT: *
- ECHO * ---------- *
- ECHO * Copyright (C) International Business Machines Corp., 1991,1992. *
- ECHO * *
- ECHO * STATUS: VERSION 1, RELEASE 0, MODIFICATION 0 *
- ECHO * *
- ECHO * DISCLAIMER OF WARRANTIES: *
- ECHO * ------------------------- *
- ECHO * The following [enclosed] code is sample code created by IBM *
- ECHO * Corporation. This sample code is not part of any standard IBM product *
- ECHO * and is provided to you solely for the purpose of assisting you in the *
- ECHO * development of your applications. The code is provided "AS IS", *
- ECHO * without warranty of any kind. IBM shall not be liable for any damages *
- ECHO * arising out of your use of the sample code, even if they have been *
- ECHO * advised of the possibility of such damages. *
- ECHO * *
- ECHO * ----------------------------------------------------------------------- *
- ECHO * *
- ECHO * Routine to demonstrate calls to and from 16-bit routines. *
- ECHO * *
- ECHO * File list: *
- ECHO * *
- ECHO * MAIN04.C - source code for the main routine *
- ECHO * SAMP04A.C - source code for a 16-bit DLL which is loaded at *
- ECHO * load time *
- ECHO * SAMP04B.C - source code for a 16-bit DLL which is loaded at *
- ECHO * run time *
- ECHO * SAMPLE04.H - header file for this sample *
- ECHO * MAIN04.DEF - module definition file for the main routine *
- ECHO * SAMP04A.DEF - module definition file for the first 16-bit file *
- ECHO * SAMP04A.DEF - module definition file for the second 16-bit file *
- ECHO * BUILD04.CMD - command file to build SAMPLE04 statically linked *
- ECHO * MAKEFILE - make file which drives the build *
- ECHO ***************************************************************************
- PAUSE
- SETLOCAL
- ECHO ************************************************************************
- ECHO Call CSETENV.CMD to set up the IBM C Set/2 environment
- ECHO ************************************************************************
- :ENV
- IF NOT EXIST ..\..\BIN\CSETENV.CMD GOTO ERROR1
- CALL ..\..\BIN\CSETENV.CMD
- GOTO CHECK
- :ERROR1
- ECHO ERROR: Failed to locate CSETENV.CMD command file
- ECHO REMEDY: Verify that CSETENV.CMD is in the \BIN directory and try again
- PAUSE
- GOTO END
- :CHECK
- ECHO ************************************************************************
- ECHO Check that all required files exist
- ECHO ************************************************************************
- IF NOT EXIST ..\..\LIB\DDE4SBS.LIB GOTO ERROR2
- GOTO BUILD
- :ERROR2
- ECHO ERROR: One or more libraries are missing
- ECHO REMEDY: Make sure that you have installed the correct libraries
- ECHO and try again
- PAUSE
- GOTO END
- :BUILD
- ECHO ************************************************************************
- ECHO Build the program
- ECHO ************************************************************************
- NMAKE "LIBRARY=DYNAMIC"
- IF NOT ERRORLEVEL 1 GOTO RUN
- ECHO ERROR: An error occurred when building the sample program
- ECHO REMEDY: Examine the error messages generated by the compiler or linker,
- ECHO correct the problem, and try again.
- PAUSE
- GOTO END
- :RUN
- ECHO ************************************************************************
- ECHO Running MAIN04.EXE
- ECHO ************************************************************************
- COPY SAMP04A.DLL ..\..\DLL > NUL:
- COPY SAMP04B.DLL ..\..\DLL > NUL:
- MAIN04
- PAUSE
- ECHO ************************************************************************
- ECHO Clean up files and environment. Then save the whales.
- ECHO ************************************************************************
- IF EXIST ..\..\DLL\SAMP04A.DLL ERASE ..\..\DLL\SAMP04A.DLL
- IF EXIST ..\..\DLL\SAMP04B.DLL ERASE ..\..\DLL\SAMP04B.DLL
- IF EXIST *.EXE ERASE *.EXE
- IF EXIST *.OBJ ERASE *.OBJ
- IF EXIST *.LIB ERASE *.LIB
- :END
- endlocal