Windows API - Compiler Support

Compiler Support

To develop software that utilizes the Windows API, a compiler must be able to handle and import the Microsoft-specific DLLs and COM-objects. The compiler must either handle the header files that expose the interior API function names, or supply such files by itself. For certain classes of applications, the compiler system should also be able to handle IDL (interface definition language) files. Collectively, these prerequisites (compilers, tools, libraries, and headers) are known as the Microsoft Platform SDK. For a long time, the Microsoft Visual Studio family of compilers and tools and Borland's compilers were the only tools that could provide this (although at least in the case of Windows, the SDK itself is downloadable for free separately from the entire IDE suite, from Microsoft Windows SDK for Windows 7 and .NET Framework 4). Nowadays, the MinGW and Cygwin projects also provide such an environment based on the GNU Compiler Collection, using a stand-alone header file collection to make linking against Microsoft DLLs possible. LCC-Win32 is a "free for non-commercial use" C compiler maintained by Jacob Navia. Pelles C is another freeware C compiler maintained by Pelle Orinius. Free Pascal is a free software Object Pascal compiler capable of writing software based on the Windows API. The MASM32 package is a mature project providing support for the Windows API under Microsoft's Macro Assembler by using custom made or converted headers and libraries from the Platform SDK. FASM allows to build Windows programs without the use of an external linker, even when running on Linux.

Windows specific compiler support is also required for the Structured Exception Handling feature (SEH). This system serves a dual purpose: it provides a substrate upon which language-specific exception handling can be implemented, and it is how the kernel notifies applications of exceptional conditions such as dereferencing an invalid pointer or stack overflow. The Microsoft/Borland C++ compilers had the ability to use this system as soon as it was introduced in Windows 95 and NT, however the actual implementation was undocumented and had to be reverse engineered for the Wine project and free compilers. SEH is based on pushing exception handler frames onto the stack, then adding them to a linked list stored in thread local storage (the first field of the thread environment block). When an exception is thrown, the kernel and base libraries unwind the stack running handlers and filters as they are encountered. Eventually, every exception unhandled by the application itself will be dealt with by the default backstop handler, which pops up the Windows common crash dialog.

Read more about this topic:  Windows API

Famous quotes containing the word support:

    For the support of this declaration we mutually pledge to each other our lives, our fortunes, & our sacred honour.
    Thomas Jefferson (1743–1826)