Article View: comp.os.os2.programmer
Article #369Re: A question or three.
From: David Charlap
Date: Tue, 11 Aug 1992 16:08
Date: Tue, 11 Aug 1992 16:08
68 lines
3667 bytes
3667 bytes
In article <1992Aug10.162757.13720@thyme.jpl.nasa.gov> kaleb@thyme.jpl.nasa.gov (Kaleb Keithley) writes:
>
>Question 1: Given the following code fragment...
>
>MRESULT EXPENTRY ClientWndProc (
> HWND hwnd,
> USHORT msg,
> MPARAM mp1,
> MPARAM mp2)
>{
> ...
> switch (COMMANDMSG (&msg)->cmd) {
> ...
>
>the compiler complains vociferously about the above line of code. I
>regret that I can't supply the actual error text, it was at home, and
>late at night. I was unable to find the prototype declaration or macro
>definition for COMMANDMSG. The above is exactly as it appears in the
>article, but I suspect that I might actually need '(COMMANDMSG (&cmd))->cmd'.
>
>Would someone be so kind as to confirm this, or tell me wherein COMMANDMSG
>is defined (I looked, but didn't find it), or tell me that COMMANDMSG is
>the wrong way to be doing this in 2.0 and tell me what the right way is?
The first thing I noticed is that the "msg" parameter is a USHORT.
Under 32-bit OS/2, it should be a ULONG.
As for the COMMANDMSG macro, I never used it. I always just did a
"switch (msg)". I believe the COMMANDMSG macro is used to extract
more detail from a WM_COMMAND message.
>Question 2: 99% of my GUI experience is with the X Window System. The
>Petzold article touches on window classes, and being able to subclass
>windows. Furthermore, the main() function in his example program bears
>a strong resemblance to the main() functions of the Xt based applications
>that I write.
>
>By contrast, when I examined the M's*ft Windows 3.0 SDK, my impression was
>that programming Windows was akin to programming X at the Xlib level,
>leading me to believe that programming for PM may be more like programming
>in Xt with a Widget set. Would anyone care to confirm or deny that
>assessment?
It sounds about right. I don't know how many parallels you can draw,
since X is a client-server model, while OS/2 and Windows aren't. What
I did notice from the Windows 3.0 spec, was that user programs have to
perform lower-level tasks than OS/2 programs have to.
>Question 3: What's the name of a good book on PM programming? Bookstar
>(large, well stocked, discount retailer) had zillions of Wind*ws 3.1 books,
>and only three titles on OS/2 -- none on programming. Anyone know of any
>books in the works?
Not too many right now. The Microsoft Press books seem to have been
discontinued (I wonder why...). Van Nostrand-Reinhold publishing has
recently released a series on OS/2 2.0 (including some programming
books). IBM has their technical library (individual volumes can be
gotten), although they're better as reference material.
Some OS/2 1.x books can be gotten. They are useful to learn concepts,
but you'll need a 2.0 reference (like the on-line one shipped with the
Toolkit) in order to get the sample code to work in 32-bits.
--
|) David Charlap "I don't even represent myself
/|_ dic5340@hertz.njit.edu sometimes so NJIT is right out!.
((|,)
~|~ Hi! I am a .signature virus, copy me into your .signature file.
Technical Details
Message-ID:
<1992Aug11.160829.7216@njitgw.njit.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!rutgers!njitgw.njit.edu!hertz.njit.edu!dic5340References:
<1992Aug10.162757.13720@thyme.jpl.nasa.gov>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!rutgers!njitgw.njit.edu!hertz.njit.edu!dic5340 From: dic5340@hertz.njit.edu (David Charlap) Newsgroups: comp.os.os2.programmer,comp.os.os2.advocacy Subject: Re: A question or three. Message-ID: <1992Aug11.160829.7216@njitgw.njit.edu> Date: 11 Aug 92 16:08:29 GMT References: <1992Aug10.162757.13720@thyme.jpl.nasa.gov> Sender: news@njit.edu Distribution: na Organization: New Jersey Institute of Technology, Newark, N.J. Lines: 68 Nntp-Posting-Host: hertz.njit.edu