PRODUCT : Borland C++ NUMBER : 653 VERSION : All OS : PC DOS DATE : October 19, 1993 PAGE : 1/2 TITLE : Abbreviated DLL Generation Procedure Below is all the code and information necessary to create a Dynamic Link Library file using Borland C++ 2.0 for Windows. It includes a sample C source file as well as the module definition file (.DEF). Instructions on how to configure Borland C++ 2.0 and compile the C source code is also listed below. Please note this is the bare minimum amount of code needed to create a DLL file and will actually do nothing if loaded by a Windows EXE file. //............................................................... // DLLTEST.C -- notice we have a LIBMAIN function instead of WINMAIN #include // Include the Windows function prototypes int FAR PASCAL LibMain(HANDLE hInstance, WORD wDataSeg, WORD wHeapSize, LPSTR lpszCmdLine) { // Any code that needs to be executed only once when the // DLL gets loaded by Windows goes here. return 1; // Success (or 0 for Failure) } int FAR PASCAL WEP(int nParameter) { return 1; } //............................................................... // DLLTEST.DEF -- notice we have a LIBRARY statement instead of // EXETYPE as well as a DATA statement ending in // the word SINGLE. LIBRARY DLLTEST DESCRIPTION 'How to create a Dynamic Link Library' CODE PRELOAD MOVEABLE DISCARDABLE DATA PRELOAD MOVEABLE SINGLE EXPORTS LibMain @1 WEP @2 //............................................................... PRODUCT : Borland C++ NUMBER : 653 VERSION : All OS : PC DOS DATE : October 19, 1993 PAGE : 2/2 TITLE : Abbreviated DLL Generation Procedure To compile the test .DLL file type: BCC -WD dlltest.c //................................................................ Make sure that Borland C++ 2.0 is in your path prior to both Microsoft C and any earlier version of Turbo C++. Example: path=c:\dos;c:\borlandc\bin;c:\xtgold;c:\tc\bin //................................................................ Make sure the TURBOC.CFG file being used has the correct path to both library and include files. Example: -Ic:\borlandc\include -Lc:\borlandc\lib 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.