Feedback Search Top Backward Forward
EDM/2

From the Editor

Written by Larry Salomon, Jr.

 

Yes, the mailing distribution was goofed up. Many of you received parts 1 and 4 only. This is because the mailer runs Sendmail in the background but forgets to wait for it to complete before deleting the files it is supposed to be mailing. Oops. My apologies for the inconvenience.

The fix to the problem has been volunteered by Gess Shankar, who runs the OS/2 Multimedia Mailing List. He offered to run the mailing distribution using his tried-and-true mailing list machine. This will allow for much more robust subscription processing as well as the ability to request back issues; those of you who are currently subscribed via the "old way" have already been moved to the new machine, so there is no need to resubscribe. To receive more information (for new readers), send an empty mail message to EDM2@knex.via.mind.org and you will receive the information file that tell you how to subscribe, etc.

I still have not heard from Gavin Baker so I will assume him to be "missing in action"; because of this I will be writing the "Introduction to Presentation Manager Programming" column and will start over from the beginning. Speaking of people missing in action, I received a note from Steve (Luzynski). He is doing well and now has a full-time job as a computer retail salesperson which leaves him with "no free time." I guess that answers the question I had about really being the editor or just being a stop-gap until he came back.

By now, many if not all of you have heard of WordPerfect's announcement to halt development on WordPerfect version 6.0 for OS/2. Who knows what this portends? I certainly do not, but I do know that I am glad I am not in Orem, Utah right now...You are probably thinking, "what the hell does this have to do with OS/2 development." Consider that a company of that size makes a decision like this for one of three reasons: political alliances could indicate a conflict of interest, marketing demand could indicate it is not worth the investment, or development strategies in the environment could make the product obsolete in a short time. My hunch is that they know something we don't about IBM's direction but we had better find out!

There is both a correction and a clarification that are noteworthy in the Scratch Patch column. Also, we need your submissions for the Snippet(s) of the Month portion of that column! Not only is group participation better, but this old dog hasn't learned all of the possible tricks in OS/2 programming. I am always looking to grow, too! (Editors note: the Scratch Patch column has been split. The Q&A section is in "Questions and Answers", the snippets of the month is in the separate section "Code Snippets & Tips" the rest follows below.)

While talking to Dick Conklin a few days ago, he asked me to mention that you might qualify for a free subscription to OS/2 Developer, another OS/2 magazine aimed at developers. Call 1-800-WANT-OS2 and ask them for the form to fill out. If you are a member of the Developers Assistance Program (DAP), be sure to indicate this on the form to guarantee your acceptance.

Some other tweaks on the magazine were made, notably, the icon file has been renamed to EDMI.ICO and the installation program has been changed accordingly. This will allow you to remove all of the previous icon files and only keep the latest on your disk. Also, an ASCII file containing the table of contents will be distributed with each issue as CONTENTS.NDX to allow you to see the titles of the articles for that month. The contents of issues 1 through 6 can be found in the Reader's Choice Awards in this issue and can also be found in the .ZIP file as OLDNDXS.NDX Many thanks to the readers who suggested these changes.

Finally, I knew this was going to happen and it did. I forgot to add two articles to this month's index - OS/2 Installable File Systems - Part 3 and Using OS/2 2.x bitmap files. Because of this, I am resending this; I would hate for them to not be considered for the Reader's Choice Awards because of my screw-up.

Corrections

Since I meant to mention this last month but forgot, I have a correction for the "Help Manager and Online Documentation" article in the October issue. It is really not a correction, but instead a better way of doing message box help. The idea is to create a dummy HELPSUBTABLE and then for each message box help id, create a HELPITEM whose first and third identifiers are the message box help id, and the second identifier is of the dummy HELPSUBTABLE. The idea is that when the user requests help, the HELPSUBTABLE will not have the appropriate entry and so the Extended Help panel (the third parameter) will be displayed.

The advantage of this is that of performance; hooks are performance eaters, so this is a nice reason to do this (according to Scott Kliger, the developer of the original Help Manager code). The disadvantage of this is that for larger applications with large numbers of different message boxes, the HELPTABLE can get rather unwieldy.

Another clarification is about last month's "Threads in PM Applications" article, where the call to DosSleep() was made in the processing of the MYM_ENDTHREAD message. The use of this function within a PM application is strongly discouraged because it can lock the system up until the call returns, but if used with caution will cause no noticeable effect. This case is just that; the thread is already dying, so the loop with the DosSleep() body will execute a minimal number of times.

Thanks go to Michael Hohner (fn0728@cd4680fs.rrze.uni-erlangen.de) for sending us both of these items.

Also, in issue 5, I stated that, for user painted buttons, BDS_DEFAULT was incorrectly defined. Instead, it is correctly defined and I was misinterpreting the definition of default. Default in this sense does not mean "paint in the default manner", but instead means that the button is the default button and should be drawn with a darker border. This is a flag that can be specified in addition to the others (BDS_HILITED and BDS_DISABLED) which are mutually exclusive of each other.

A value of 0 can still be received for fsState (in the USERBUTTON structure, so a new constant should be defined for this value (I named it BDS_NORMAL).

Documentation Chop Shop

A few of you may have noticed, but in the OS/2 2.1 Toolkit, IBM once again forgot to define the container record attribute CRA_SOURCE. It is wise to define it directly in the pmstddlg.h file with the value 0x00004000L.

When we received our copy of the new C-Set++ compiler, I installed it and immediately proceeded to test for a successful installation by writing a C++ style "Hello world" program. After many unsuccessful attempts to get the program to link successfully, I was told that the compiler does not insert the default library object record for the C++ class libraries and that the user must do so explicitly. This is not stated in the documentation; the libraries are listed below:

  • DDE4MUIB.LIB, DDE4MUIC.LIB, and DDE4MUID.LIB for the standard and user-interface class libraries, statically linked.
  • DDE4CC for the container class libraries, statically linked.

It should be noted that statically linking these libraries ballooned the "Hello world" application to 131584 bytes! It is thus recommended that you use the dynamically linked run-time (DDE4MUII.LIB for the standard/user-interface class libraries and DDE4CCI.LIB for the container class libraries) and distribute the DLL's (which are royalty free, but require that you agree to the conditions listed on page 12 of the "C/C++ Tools License Information" pamphlet) with your application.

In issue 2, I described how dropping on a printer does not send you a pointer to the DRAGINFO structure, but instead to a DRAGITEM structure corresponding to one of the items dropped on the printer sending the message. Well, it appears that, in OS/2 2.1, the system forgets to grant you access to the structure (if you think about it, however, this makes more sense than before, but they should still pass the PDRAGINFO structure instead). How do you access the data? Well, fortunately, the DrgAccessDraginfo() function is not picky about whether or not its argument is a PDRAGINFO or a PDRAGITEM, so insure that you call this function before trying to access the structure's contents, or you are sure to receive a protection violation.

As a related topic, when you are initializing the PDRIVDATA field of the DEVOPENSTRUC structure, after allocating the memory, do not forget to set the cb field equal to the size of the buffer. Otherwise, calling DevPostDeviceModes() to initialize this buffer will cause a protection violation.

Want Ads

Below are the hot topics as of this issue's writing. Feel free to write on any of these.

Workplace Shell Programming (hot)
lately, I have noticed two things: 1) lots of people want to learn how to write new Workplace Shell classes and 2) no one who knows anything about it is telling the rest of us how to do it. I'll even stoop down to accepting an article in ASCII format on this topic! :)

Client/Server (hot)
using either named pipes (with or without a network) or sockets, client/server programming is all-the-rage these days. On a related note, some people have also expressed an interest in learning about interfacing with the various protocol drivers (e.g. NDIS, IPX/SPX, etc.). Any articles in this area are most welcome.

Anything on Rexx/2 (hot)
many people have requested more articles on Rexx/2. This issue sees the first article on this topic, but we can always use more. Writing "Enhanced Editor" macros in Rexx/2 and interfacing with the Workplace Shell from Rexx/2 are still open topics.

Using Input Hooks (warm)
this is a complicated topic which was brought up frequently in the comp.os.os2.programmer.misc newsgroup.

Hit testing (warm)
one reader noted that the Jigsaw sample in both the IBM and Borland toolkits (are they not the same?) perform there own correlation and wondered why? Charles Petzold, in his OS/2 book "Programming the OS/2 Presentation Manager" briefly describes correlation and hit-testing, but does not go into any detail nor does it describe the Gpi functions used for this purpose.

Animation (warm)
a few readers expressed an interest in the various animation techniques that can be applied to PM applications. The ultimate article, in my opinion, would be one that develops a sprite library a la the Commodore 64's (and Amiga's?) built-in routines, since this is probably the hardest component of any good animation sequence.

Reader's Choice Awards

It is the end of our first calendar year in production and since we released our first issue in March of this year, we figured it made more sense to do this now instead of in February (otherwise, we will receive many questions asking why we didn't do this now). So, without further ado, 'tis time for...

The First Annual

The editors want to know what you think the top three articles written during the past year are. Please mail your responses to os2man@panix.com and indicate on what network you get EDM/2, if it is not the Internet (or the auto-mailer). For your convenience, the article titles have been included below.

The "rules of the game" are...

  • Article series can be treated as either one entity or a group of separate articles.

  • Each issue's columns should be treated as separate articles and can be voted for separately.

  • If you wrote an article or a column, you may vote, but you may not vote for something that you authored.

  • The three people that receive the most votes are placed in order of the number of votes received. Each person can place only once; thus, if John Doe receives the most and second-most votes, while James Smith receives the third-most, John is awarded first place and James is awarded second.

  • All votes must be email-dated before January 1, 1994.

The winners of the Reader's Choice Awards not only get recognition in the next issue of the magazine, but they will also get a goodie (or two) which will not be revealed until the next issue.

An index of the past seven issues:

  • A Review of C++ Compilers (issue 5)
  • Advance GPI: Retained Segments and Transformations (issue 1)
  • Beginning Client/Server Programming: Named Pipes (issue 2)
  • C++ Encapsulation of PM (issue 4)
  • Customizing the Enhanced Editor (issue 6)
  • DOS Development Tools Under OS/2 (issue 3)
  • Development of a New Window Class - Part 1 (issue 4)
  • Development of a New Window Class - Part 2 (issue 5)
  • Getting Started with EMX/GCC (issue 1)
  • Introduction to PM - Gavin Baker (column)
  • Introduction to PM - Larry Salomon, Jr. (column)
  • OS/2 Installable File Systems - Part 1 (issue 3)
  • OS/2 Installable File Systems - Part 2 (issue 5)
  • OS/2 Installable File Systems - Part 3 (issue 7)
  • OS/2 Presentation Drivers in a Nutshell (issue 2)
  • Programming the Container Control - Part 1 (issue 3)
  • Programming the Container Control - Part 2 (issue 4)
  • Programming the Container Control - Part 3 (issue 5)
  • Questions and Answers (column)
  • Rexx-ercising Your Applications (issue 6)
  • Rexx-ercising Your Applications - Part 2 (issue 7)
  • Road Map for the Workplace Shell (issue 2)
  • Scratch Patch (column)
  • The Help Manager and Online Documentation (issue 5)
  • The Making of MineSweeper (issue 1)
  • The Unofficial Guide to the Palette Manager (issue 1)
  • Threads in PM Applications (issue 6)
  • Using OS/2 2.x bitmap files (issue 7)
  • Writing a C++ Thread Class (issue 6)
  • Writing a Direct Manipulation Spy (issue 7)