Library management

From EuWiki

Jump to: navigation, search

win32lib is a large library which hardly requires any cooperation from the user. Yet some limited interaction is provided.

Current version

There is a Win32LibVersion constat available. All the pages in this category were started while this sequence was {0,70,3, "22-Dec-2007"}. The format is documented as {major version,minor version,patch level,release date string}. See the EX08.exw demo program for an example of use.

The indexes for the various parts of this sequence are called

  • Win32LibVersionMajor
  • Win32LibVersionMinor
  • Win32LibVersionPatch
  • Win32LibVersionDate

Since there may be intermediate releases between consecutive patches, there is a variant called Win32LibVersionEx which also returns the revision information. For instance, an intermediate release prior to the current official one was IDing as {0,70,2,'e',"14-Dec-2007"}. Like above, members of this record have a name:

  • Win32LibVersionExMajor
  • Win32LibVersionExMinor
  • Win32LibVersionExPatch
  • Win32libVersionExRevision
  • Win32LibVersionExDate

As you can see, the first three members for both records are the same.

Control creation

The validId(some_integer) enables you to check whether any integer is the id of a control the current application created in the framework of the library and which still exists.


The setControlBlocks(num_controls) will help the library optimizing bulk control creation. num_controls is the number of controls you plan to create shortly. There is no need to call this procedure, but it may speed up application startup or windows first time opening. Space for 16 controls is allocated initially. If num_controls is less than 1, 16 is assumed.


A parallel routine_id system

win32lib maintains an internal list that matches routine names with routine ids.

To register a routine there, call registerRoutine(name,id). This oly connects a name with an existing id. This could be used to dispatch a call to a non existing routine to various existing routines, for instance. This is used intensively in forms, because some handlers are implicit and handler names are coined using the names of the control and event. See for instance the bitmap.exw demo.


To retrieve the id currently associated to a name, call w32routine_id(name).


Internally, this is used by w32start.ew when it has to coin names to event handlers knowing only control names, but may have other uses as well. At any rate, the mechanism is available.

Personal tools