Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Blinker 5.10 Online Reference - <b> generic dos extended only dll example</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 Generic DOS extended only DLL example
------------------------------------------------------------------------------
 The example programs in the \C\DLL\EXT subdirectory of the Blinker
 installation directory show how to create a DOS extended program which loads
 and executes a DOS extended only DLL which uses the printf() run time
 library function. Please refer to the make file for more details, but to use
 Microsoft Visual C++ 1.5 as an example, the compile lines would resemble the
 following:

 CL -c -AL t.c              Normal compile for main program
 CL -c -AL -GD d.c          Compile for a DLL

 Now create a link script file for the DLL, including an export definition
 for the function to be exported, and link the DLL using the same libraries
 as for the main DOS extended program, in this case BLXMVC15 and LLIBCE.
 As before, explicitly declaring a symbol as exported gives the programmer
 more control over how the symbol is exported. Now use an import librarian
 such as BLILIB (see the section `The BLILIB import librarian' in Chapter 4)
 to create an import library which can be linked with the calling program:

 # D.LNK to create DOS extended D.DLL
 BLI EXECUTABLE EXTENDED    # Create DOS extended program
 OUTPUT d                   # The output file name
 FILE d                     # List OBJ files here
 DEFBEGIN                   # Module definition commands
    LIBRARY  'd'            # Indicate a DLL and its name
    EXPORTS                 # Export the following symbols
       _test                # Export _test by name
 DEFEND                     # End module definition commands
 LIB BLXMVC15               # Blinker protected mode library
 BLINKER @d                 # Link the .DLL
 BLILIB /IDd /OLd /NP       # Create the import library

 Finally, create the main link file to use the generated import library
 instead of linking the D.OBJ file directly:

 # T.LNK to create T.EXE
 BLI EXECUTABLE EXTENDED    # Create DOS extended program
 OUTPUT t                   # The output file name
 FILE t                     # List OBJ files here
 LIB D                      # The import library just created
 LIB BLXMVC15               # Blinker protected mode library
 BLINKER @T                 # Link the .EXE

 This should now have created T.EXE which will load and execute the code in
 D.DLL, although Windows programs will not be able to use D.DLL.

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson