Article View: comp.os.os2.programmer
Article #350Re: A question or three.
From: Peter Forsberg
Date: Tue, 11 Aug 1992 09:25
Date: Tue, 11 Aug 1992 09:25
38 lines
2091 bytes
2091 bytes
In <1992Aug10.162757.13720@thyme.jpl.nasa.gov> Kaleb Keithley writes:
>I'm trying to get up to speed on PM programming, so I dragged out my
>old issues of Micros*ft Journal and started typing in Charles Petzold's
>Checkers program. I'm using the non-EMX gcc, if that makes a difference.
>
>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?
>(...)
Firstly, under 2.0 the message parameter (msg) to your client window
procedure should be a ULONG, not a USHORT.
Secondly, I seem to remember that COMMANDMSG wasn't defined in early
beta releases of the 2.0 toolkit. I furthermore suspect that the PD
compilers' headerfiles (GCC, EMX ?) are based upon some beta release
of the 2.0 toolkit. In the GA toolkit headerfiles (PMWIN.H),
COMMANDMSG is defined:
typedef struct _COMMANDMSG /* commandmsg */
Technical Details
Message-ID:
<19920811.003756.988@almaden.ibm.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!vnet.ibm.comReferences:
<1992Aug10.162757.13720@thyme.jpl.nasa.gov>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!vnet.ibm.com From: peterf@vnet.ibm.com (Peter Forsberg) Message-ID: <19920811.003756.988@almaden.ibm.com> Date: Tue, 11 Aug 92 09:25:44 SWE Newsgroups: comp.os.os2.programmer,comp.os.os2.advocacy Subject: Re: A question or three. Reply-To: peterf@vnet.ibm.com Organization: IBM Corporation Disclaimer: This posting represents the poster's views, not those of IBM News-Software: UReply 3.0 References: <1992Aug10.162757.13720@thyme.jpl.nasa.gov> Lines: 38