[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
From the programmer's point of view, Windows can be rather
daunting. This is especially true initially, as there are so
many features, functions and new buzz-words to get used to.
However, many of these can be safely ignored until you feel
more comfortable with the core functionality (and some can be
ignored for good).
An important aspect of Windows is that, wherever reasonable,
programs should not control the user's actions and/or choices.
Doing so is termed "modal" (you are probably familiar with
Clipper's ReadModal() function). The preferred "modeless"
applications are not terribly hard to write, but you will
probably have to change your style somewhat. In particular,
you will find much of your existing code can be kept, but
needs turning into (typically small) functions which respond
to the user's actions.
Being driven by the user's actions is what "event driven"
programming is all about. It is so central to working with
Windows that there is a separate sub-section covering this
topic. Also, you will rapidly discover that a handy way to
cope with events is to use Objects which get sent the events,
and decide what to do with them. If a particular object finds
the event is not appropriate, it can indicate to the sender
that it didn't handle the event, and the sender can decide
what to do next (send the event to another object or handle it
itself).
Having said above that your existing code may need turning
into small functions which respond to the user's actions, you
will now realise that object-oriented programming is ideal:
they become methods. Since much of OOP is about "programming
by differences", you can write general purpose methods which
will be inherited by derived classes (also called sub-
classes). Then, if the new class needs different behaviour
you just write the new chunks of code -- leaving the bulk of
the code unchanged.
The terminology used by Windows is covered in the sub-section
"Windows Terminology".
There is also a sub-section "Events and Event Handling", which
discusses some of the things you need to know about Windows (a
lot of events are handled automatically by Clip-4-Win).
Online resources provided by: http://www.ClipX.Net --- NG 2 HTML conversion by Dave Pearson