Article View: comp.os.os2.programmer
Article #368Re: A question or three.
From: Larry Salomon Jr.
Date: Tue, 11 Aug 1992 22:27
Date: Tue, 11 Aug 1992 22:27
91 lines
4675 bytes
4675 bytes
In <1992Aug10.162757.13720@thyme.jpl.nasa.gov> kaleb@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?
COMMANDMSG is a macro that was removed from the 32-bit toolkit (both GCC and
IBM's). Use SHORT1FROMMP(mp1) instead.
>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 is my opinion (implies disclaimer) that Windows and PM programming are
very similar.
>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?
Charles Petzold's "Programming the OS/2 Presentation Manager" is a very good
starter, although it was written for OS/2 1.2.
>Question 4: If you're listening IBM, start putting some *real* tools into
>OS/2. FIND.EXE is so *very* dated. I'd think after all these years it
>could at least handle wild cards in the file name! After three years of
>working on UNIX, I'd forgotten how much I relied on third party development
>tools to do development under D*S. I guess some things never change. Last
>night was like a trip through a black hole back into time.
Try PMSEEK in the Productivity folder.
>And, while we're on the subject, how to I jump directly to a line by the
>line number in the enhanced editor, I'd hate to think what I'd have to do
>with some of these multi-thousand line source files some people like to
>write. What's the magic incantation to set CAPS_LOCK (it's not the
Press CTRL+I and enter the line number. Then press Shift+F5 to center the
line in the window.
>CAPS_LOCK key, that's for certain), and why doesn't my CAPS_LOCK light
>on my keyboard toggle on and off when I press the CAPS_LOCK key? No, it's
>not burnt out. And lastly, why does the enhanced editor seem to freeze
>up for two or three seconds at a time for no apparent reason?
Probably because your machine is running out of resources (memory)? The
enhanced editor doesn't come cheap, and while it is better than it used to
be when it was "internal only", it still consumes quite a lot of stuff.
>Okay, I don't really expect any real answers to these last couple of
>questions, I'm just venting my spleen, but if you happen to know...
Cheers,
Q
--
-----------------------------------------------------------------------
"If you still choose not to decide, | "My other account is in the
you still have made a choice" - Rush | shop" - me
-----------------------------------------------------------------------
Technical Details
Message-ID:
<1992Aug11.222749.29690@panix.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!europa.asd.contel.com!darwin.sura.net!jvnc.net!yale.edu!cmcl2!panix!os2manReferences:
<1992Aug10.162757.13720@thyme.jpl.nasa.gov>Show Full Headers
Complete Article Headers
Newsgroups: comp.os.os2.programmer,comp.os.os2.advocacy Path: arc1-ca.pugleaf.net!sparky!uunet!europa.asd.contel.com!darwin.sura.net!jvnc.net!yale.edu!cmcl2!panix!os2man From: os2man@panix.com (Larry Salomon Jr.) Subject: Re: A question or three. Message-ID: <1992Aug11.222749.29690@panix.com> Date: Tue, 11 Aug 1992 22:27:49 GMT Distribution: na References: <1992Aug10.162757.13720@thyme.jpl.nasa.gov> Organization: PANIX Public Access Unix, NYC Lines: 91