home *** CD-ROM | disk | FTP | other *** search
- @echo off
- cls
- ECHO ***************************************************************************
- ECHO * SAMPLE PROGRAM: SAMPLE05 - dynamically linked *
- 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 a global DLL using shared memory. *
- ECHO * *
- ECHO * File list: *
- ECHO * *
- ECHO * SAMPLE05.C - source code to create the DLL *
- ECHO * SAMPLE05.H - header file for this sample *
- ECHO * SAMPLE05.DEF - module definition file for the DLL *
- ECHO * MAIN05.C - source code to create the EXE *
- ECHO * MAIN05.DEF - module definition file for the EXE *
- ECHO * BUILD05D.CMD - command file to build SAMPLE05 dynamically linked *
- 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\DDE4NBSI.LIB GOTO ERROR2
- IF NOT EXIST ..\..\LIB\DDE4SBSI.LIB GOTO ERROR2
- IF NOT EXIST ..\..\DLL\DDE4NBS.DLL GOTO ERROR2
- IF NOT EXIST ..\..\DLL\DDE4SBS.DLL GOTO ERROR2
- GOTO BUILDDLL
- :ERROR2
- ECHO ERROR: One or more libraries or DLLs are missing
- ECHO REMEDY: Make sure that you have installed the correct libraries
- ECHO and DLLs. Then try again.
- PAUSE
- GOTO END
- :BUILDDLL
- ECHO ***************************************************************************
- ECHO * Building DLL *
- ECHO * *
- ECHO * icc /Rn /O+ /Ge- /Gd+ SAMPLE05.C SAMPLE05.DEF *
- ECHO * *
- ECHO * compiler options: *
- ECHO * *
- ECHO * /Rn : use the subsystems development library *
- ECHO * /O+ : generate optimized code *
- ECHO * /Ge- : build a .DLL file *
- ECHO * /Gd+ : dynamically link the C runtime functions *
- ECHO * *
- ECHO ***************************************************************************
- icc /Rn /O+ /Ge- /Gd+ SAMPLE05.C SAMPLE05.DEF
- IF NOT ERRORLEVEL 1 GOTO BUILDEXE
- ECHO ERROR: Failed to compile and/or link SAMPLE05.C
- ECHO REMEDY: Make sure that you have installed the correct components
- ECHO and try again
- PAUSE
- GOTO END
- :BUILDEXE
- ECHO ***************************************************************************
- ECHO * Building EXE *
- ECHO * *
- ECHO * icc /O+ /Gd+ /B"/BASE:0x10000" MAIN05.C MAIN05.DEF *
- ECHO * *
- ECHO * compiler options: *
- ECHO * *
- ECHO * /O+ : generate optimized code *
- ECHO * /Gd+ : dynamically link the C runtime functions *
- ECHO * /B : pass options to linker *
- ECHO * *
- ECHO ***************************************************************************
- icc /O+ /Gd+ MAIN05.C MAIN05.DEF
- IF NOT ERRORLEVEL 1 GOTO RUN
- ECHO ERROR: Failed to compile and/or link MAIN05.C
- ECHO REMEDY: Make sure that you have installed the correct components
- ECHO and try again
- PAUSE
- GOTO END
- :RUN
- COPY SAMPLE05.DLL ..\..\DLL > NUL:
- ECHO ************************************************************************
- ECHO Running MAIN05.EXE
- ECHO ************************************************************************
- MAIN05
- PAUSE
- ECHO ************************************************************************
- REM Clean up files and environment
- ECHO ************************************************************************
- :CLEANUP
- IF EXIST ..\..\DLL\SAMPLE05.DLL ERASE ..\..\DLL\SAMPLE05.DLL
- IF EXIST SAMPLE05.DLL ERASE SAMPLE05.DLL
- IF EXIST SAMPLE05.OBJ ERASE SAMPLE05.OBJ
- IF EXIST MAIN05.EXE ERASE MAIN05.EXE
- IF EXIST MAIN05.OBJ ERASE MAIN05.OBJ
- :END
- endlocal