If you choose to make a convertible application, you will not be able to call the Microsoft Windows functions directly, although you can call those contained in the DP4 file WINCALL.H if you use Metaware C. We strongly recommend that you build programs that call Windows functions as native Windows applications rather than convertible applications.
A DP4 DOS executable can be converted to a Windows application using EXE2OS2:
EXE2OS2 -WINDOWS
application name
This will produce a file with the extension .WIN. This distinguishes it from the pre-conversion .EXE file. Windows requires a .EXE extension, so copy or rename the .WIN file to a file with a .EXE extension. You will have to run the resource compiler against to make it executable
In summary, you can use the DP4 facilities as follows (with either Metaware or Microsoft C):
DP4LINK /c progname (link convertible program)You can use any version of the Microsoft linker. Your application is linked with the DOS version of the libraries when using Microsoft C.
You should build an .RC file for each program, as described later. You can eliminate the need to run RC by specifying an additional command tail, −FONT, to EXE2OS2.
MS-DOS Executables linked prior to DP4 version 4.500 must be relinked because the root code used then is not compatible with MCUMMY.WIN or HCDUMMY.WIN.
There are two methods of building a native DP4 Windows application:
Link with MCROOT8 or HCROOT8. Using this method with Microsoft C you do not necessarily need the SLIBCAW.LIB library. You may call Windows functions directly, but only in Microsoft C (unless you are capable of adding inline assembler to restore the es register) . Furthermore, your executable can be processed by the DP4 utilities KENTCURS and PROGDATE. You are restricted to small model for both Metaware and Microsoft.
You must have a Windows or OS/2 linker (a segmented executable linker). The DP4 linker batch files should be able to produce windows programs like this if you specify the /8 option.
Linking using the /w option on DP4LINK (or QABLINK). The advantage is that you are not restricted to small model, although in Microsoft C you must have ?LIBCAW.LIB or ?LIBCEW.LIB.
You must have a Windows or OS/2 linker (a segmented executable linker).
You will need to invoke the RC program as above or run MARK.
Note that large model Microsoft programs or big model Metaware programs may allow only one instance of themselves to be run, particularly if you are linking with the QAB libraries. There are also other pitfalls which can cause your program to generate protection faults if compiled in large model. For example, using showc() or prnc() on literal strings which are not the same length as field in which they are being shown.
DP4 supplies a Microsoft module-definition file named DP4WIN.DEF as part of its Programming Tools Pack. It is used when linking a native Windows program using the DP4-supplied batch files QABLINK.BAT or DP4LINK.BAT. If you wish to use a different module-definition file, you should note the following: