Compiling WinG Applications

WinG.DLL is a standard 16 bit DLL with PASCAL calling convention exports; WinG32.DLL is a standard Win32 DLL with _stdcall exports. You should be able to write WinG applications with any compiler in any language that can generate Windows 16 bit or Win32 executables that call DLLs.

16 bit Applications

Most 16 bit Windows compilers and linkers are standardized, so you should have no trouble linking to the wing.lib file provided in the WinG SDK. If you do have trouble, try using your compilers import librarian if possible, import the WinG functions directly in your .def file or its equivalent, or dynamically link to WinG.DLL using LoadLibrary and GetProcAddress.

32 bit Applications

Compiling and linking for Win32 can be tricky with some compilers. Several major compilers require various incantations to successfully build a Win32 application. Hopefully, the following hints will aid in the successful compilation and linking of WinG applications using these compilers.

The WinG32.lib file in the WinG SDK is a Common Object File Format (COFF) library file. Most non-Microsoft Win32 compilers support only Object-Module Format (OMF) library files, so you may have problems linking to WinG32 functions. If you encounter link problems, first see if your compiler has an "import librarian," a program that creates a library file from a DLL. Run this program on WinG32.dll and try linking with the generated library file. If this doesn't work or you don't have an import librarian, try explicitly importing the functions in your .def file. As a last resort you can dynamically link to WinG32 using LoadLibrary and GetProcAddress.

Borland

Run implib on WinG32.dll or modify the .def file.

Symantec

Run implib on WinG32.dll or modify the .def file.

Watcom

The Watcom linker will have trouble linking to the wing32.lib export file included with the WinG Development Kit. This export file lists undecorated names, using the conventions established for Alpha, MIPS, and x86 cross-assembly. To create a new wing32.lib file linkable with the Watcom tools, run wlib on win32.dll as follows:

wlib wing32 @wing32.lbc

where wing32.lbc is a text file containing the following description of the WinG functions:

++'_WinGBitBlt'.'WING32.DLL'..WinGBitBlt

++'_WinGCreateBitmap'.'WING32.DLL'..WinGCreateBitmap

++'_WinGCreateDC'.'WING32.DLL'..WinGCreateDC

++'_WinGCreateHalftoneBrush'.'WING32.DLL'..WinGCreateHalftoneBrush

++'_WinGCreateHalftonePalette'.'WING32.DLL'..WinGCreateHalftonePalette

++'_WinGGetDIBColorTable'.'WING32.DLL'..WinGGetDIBColorTable

++'_WinGGetDIBPointer'.'WING32.DLL'..WinGGetDIBPointer

++'_WinGRecommendDIBFormat'.'WING32.DLL'..WinGRecommendDIBFormat

++'_WinGSetDIBColorTable'.'WING32.DLL'..WinGSetDIBColorTable

++'_WinGStretchBlt'.'WING32.DLL'..WinGStretchBlt