Browse Prior Art Database

Method for Initializing a Plateform and Code Independent Library

IP.com Disclosure Number: IPCOM000114513D
Original Publication Date: 1994-Sep-01
Included in the Prior Art Database: 2005-Mar-28
Document File: 2 page(s) / 68K

Publishing Venue

IBM

Related People

Ramu, RN: AUTHOR [+2]

Abstract

Porting code to other platforms is becoming more common with the existence of many operating systems. Development tools that mask the operating system details are becoming more prevalent as well in order to help ease the porting effort. Often, these tools are implemented as libraries for each platform which handle the interface to the operating system, thus hiding the characteristics of the platform as much as possible.

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 52% of the total text.

Method for Initializing a Plateform and Code Independent Library

      Porting code to other platforms is becoming more common with
the existence of many operating systems.  Development tools that mask
the operating system details are becoming more prevalent as well in
order to help ease the porting effort.  Often, these tools are
implemented as libraries for each platform which handle the interface
to the operating system, thus hiding the characteristics of the
platform as much as possible.

      In OS/2* and Windows** these libraries would take the form of a
Dynamic Link Library (DLL).  To create a tool where the applications
code completely ports from one platform to the other means that no
operating system details can be in this code.  Some platforms offer a
challenge in accomplishing this goal.  The Windows platform has a
unique method of initializing its application that generates some
system handles that are required by the DLL.  Because Windows offers
no way for the programmer to query these handles and the programmer
is expected to save them off at initialization time, some platform
independent mechanism to pass this data to the library must be
invented.

      Windows requires that you code a WinMain function instead of a
main function.  This is completely different from OS/2 and AIX* C
language programming.  For these two platforms, a standard main
function is used.  The main function has as its parameters argc and
argv.  The argc parameter indicates the number of arguments and the
argv parameter is a pointer to the argument list.  With the WinMain
function, the parameters are the instance handle, previous instance
handle, program parameter data, and a start minimized indicator.  The
instance handle and p...