home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1993 #2 / Image.iso / magazine / wpj1_6.zip / WPJV1N6.TXT < prev   
Text File  |  1993-06-12  |  106KB  |  2,474 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.               WW     WW     WW      PPPPPPPP              JJ
  8.               WW     WW     WW      PP    PP              JJ
  9.                WW   WWWW   WW       PP    PP              JJ
  10.                WW  WW  WW  WW       PPPPPPPP              JJ
  11.                WW  WW  WW  WW       PP             JJ     JJ
  12.                 WWWW    WWWW        PP              JJ   JJ
  13.                  WW      WW         PP               JJJJJ
  14.  
  15.           ----------------------------------------------------------------
  16.           The Windows Programmer's Journal                       Volume 01
  17.           Copyright 1993 by Peter J. Davis                       Number 06
  18.           and Mike Wallace                                          Jun 93
  19.           ----------------------------------------------------------------
  20.           A monthly  forum for  novice-advanced programmers to  share ideas
  21.           and concepts  about programming in the  Windows (tm) environment.
  22.           Each  issue is uploaded  to the info systems  listed below on the
  23.           first of the month, but made available at the convenience  of the
  24.           sysops, so allow for a couple of days.
  25.  
  26.           You can get in touch with the editors via Internet or Bitnet at:
  27.  
  28.           HJ647C at GWUVM.BITNET   or   HJ647C at GWUVM.GWU.EDU  (Pete)
  29.  
  30.           CompuServe: 71141,2071 (Mike)
  31.  
  32.           GEnie: P.DAVIS5
  33.  
  34.           or you can send paper mail to:
  35.  
  36.           Windows Programmer's Journal
  37.           9436 Mirror Pond Dr.
  38.           Fairfax, Va. 22032
  39.  
  40.           We can also be reached by phone at: (703) 503-3165.
  41.  
  42.           The WPJ BBS can be reached at: (703) 503-3021.
  43.  
  44.           The WPJ  BBS  is currently  2400 Baud  (8N1). We'll  be going  to
  45.           14,400 in the near future, we hope.
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.                                      LEGAL STUFF
  62.  
  63.  
  64.           - Microsoft,  MS-DOS, Microsoft Windows, Windows  NT, Windows for
  65.           Workgroups,  Windows for  Pen  Computing, Win32,  and Win32S  are
  66.           registered trademarks of Microsoft Corporation.
  67.  
  68.           -  Turbo Pascal for Windows,  Turbo C++ for  Windows, and Borland
  69.           C++   for   Windows   are   registered   trademarks   of  Borland
  70.           International.
  71.  
  72.           -   WordPerfect   is  a   registered  trademark   of  WordPerfect
  73.           Corporation.
  74.  
  75.           - Other  trademarks mentioned  herein are the  property of  their
  76.           respective owners.
  77.  
  78.           -  WPJ is available from the WINSDK, WINADV and MSWIN32 forums on
  79.           CompuServe, and  the IBMPC, WINDOWS and BORLAND  forums on Genie.
  80.           It  is also  available  on  America  Online  in  the  Programming
  81.           library.   On Internet,  it's available on WSMR-SIMTEL20.ARMY.MIL
  82.           and FTP.CICA.INDIANA.EDU.  We upload it by the 1st  of each month
  83.           and it is usually available by  the 3rd or 4th, depending on when
  84.           the sysops receive it.
  85.  
  86.           - The  Windows Programmer's  Journal takes no  responsibility for
  87.           the  content of the  text within this  document. All  text is the
  88.           property  and  responsibility  of  the  individual  authors.  The
  89.           Windows  Programmer's Journal  is solely  a vehicle  for allowing
  90.           articles to be  collected and distributed in a common and easy to
  91.           share form.
  92.  
  93.           - No part of the Windows Programmer's Journal may be re-published
  94.           or  duplicated in  part  or whole,  except  in the  complete  and
  95.           unmodified form of the  Windows Programmer's Journal, without the
  96.           express written permission of each individual author. The Windows
  97.           Programmer's  Journal  may not  be  sold for  profit  without the
  98.           express  written permission  of the  Publishers, Peter  Davis and
  99.           Michael  Wallace,   and  only  then  after   they  have  obtained
  100.           permission from the individual authors.
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.                               Table of Contents
  115.  
  116.           Subject                                        Page Author(s)
  117.           --------------------------------------------------- ------
  118.           WPJ.INI .....................................     4 Pete Davis
  119.  
  120.           Letters .....................................     8 Readers
  121.  
  122.           Beginner's Column ...........................    12 Dave Campbell
  123.  
  124.           Internally Yours ............................    15 Pete Davis
  125.  
  126.           Pascal in 21 Steps ..........................    18 Bill Lenson
  127.  
  128.           Moving Away from ...  .......................    29 Pete Davis
  129.  
  130.           C++ Beginner's Column .......................    30 Rodney Brown
  131.  
  132.           WPJ BBS Update ..............................    31 Pete Davis
  133.  
  134.           Windows Messaging ...........................    32 Mike Wallace
  135.  
  136.           WinEdit Review ..............................    35 Jeff Perkell
  137.  
  138.           White House Letter ..........................    38 Mike Strock
  139.  
  140.           Text Manager ................................    40 Mike Wallace
  141.  
  142.           Getting in Touch with Us ....................    42 Pete & Mike
  143.  
  144.           Last Page ...................................    43 Mike Wallace
  145.  
  146.  
  147.           Windows Programmer's Journal Staff:
  148.  
  149.           Publishers ......................... Pete Davis and Mike Wallace
  150.           Editor-in-Chief .................... Pete Davis
  151.           Managing Editor .................... Mike Wallace
  152.           Contributing Editor ................ Dave Campbell
  153.           Contributing Editor ................ Bill Lenson
  154.           Contributing Editor ................ Rodney Brown
  155.           Contributing Editor ................ Mike Strock
  156.                                               
  157.           Contributing Writer ................ Jeff Perkell
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.                                        WPJ.INI
  169.                                     by Pete Davis
  170.  
  171.                Ah, it's that time of month again (actually, a bit past it).
  172.           As  usual,  we're  late.  Lately  we've  been  getting  VERY  FEW
  173.           SUBMISSIONS!!!!! Come  on people, let's get  things moving along.
  174.           I'm  serious, we're going to  have to switch  over to every other
  175.           month if things  don't pick up. We get a lot  of mail from people
  176.           saying, "yeah,  I want to  write about  ..." and we  say, "Great,
  177.           let's see  it." But it  never shows  up. I hate  to start off  an
  178.           issue complaining,  but  really...  Sure,  everyone's  busy,  but
  179.           s   u   r   e   l   y   y   o   u   c   a   n   t   a   k   e   a
  180.           few hours now and then to put together an article. Do you realize
  181.           that if only  1% of  our readers actually  wrote an article  we'd
  182.           have  more articles  than we  know what  to do  with? And  still,
  183.           99.999% of you don't take the time to submit an article.
  184.  
  185.                I  know what  you're thinking,  what's in  it for  me? Well,
  186.           let's  start with my story. Sure, I'm  one of the editors and the
  187.           publishers, but this isn't exactly a 'real' magazine. Yet, I have
  188.           signed a contract to write a book and I've got a two part article
  189.           showing up in Dr. Dobb's Journal (more on this later).
  190.  
  191.                Does that  mean that any of you can do it? Actually, yes, it
  192.           does.  I'm no genius, I'm just a  regular guy willing to take the
  193.           time to  do the work. You  may remember Alex Federov,  one of our
  194.           earliest  contributors. You can  look forward to  seeing his next
  195.           article  in Dr. Dobb's Journal also! Not  to hack on Alex, he's a
  196.           smart  guy and a good guy. His english isn't perfect. Reading his
  197.           writing, you know  it's not his native  language, yet here  he is
  198.           writing  for Dr. Dobb's Journal  only a few  months after writing
  199.           for us. I'm not saying that  we're the reason he got published in
  200.           Dr. Dobb's. But I doubt that writing his first few article for us
  201.           did any damage.
  202.  
  203.                You'd be surprised who reads this magazine.  I only recently
  204.           found  out  that  Rob  Burk, Editor  of  Windows/DOS  Developer's
  205.           Journal  reads this magazine.  I know it has  been read by Andrew
  206.           Schulman (see his  letter in Issue  #2). I am told  that Mitchell
  207.           Waite  of the Waite Group Press has  also read it. Whether or not
  208.           these  people read  it regularly  or not,  I don't know.  I'm not
  209.           trying  to pat  myself on  the back  here, I'm  just saying  that
  210.           articles written for our  magazine don't necessarily go unnoticed
  211.           by others in the industry.
  212.  
  213.                I'm sorry to be going off like this, I should be chipper and
  214.           happy, but I'd  just REALLY HATE to see this  magazine have to go
  215.           to every other month. From the response I've gotten from a lot of
  216.           our  readers, they  don't want  to see  that happen  either, yet,
  217.  
  218.                                         - 4 -
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.           where are their articles?
  227.  
  228.                Ok, enough of that, you  guys figure out if you want  to get
  229.           it every month. Remember, it's only going to take a few of you to
  230.           make the difference and if you're counting on  someone else to do
  231.           it, forget it, they haven't done it yet.
  232.  
  233.                On to happier things... Yes, as  I mentioned, I have a  two-
  234.           part  article  coming  out  in  Dr.  Dobb's   Journal  in  Andrew
  235.           Schulman's "Undocumented Corner" column  (which happens to be the
  236.           same one Alex  Federov's article is in). I don't  want to say too
  237.           much about  it, basically because  I haven't checked  with Andrew
  238.           about how much I can say. I will simply say it involves work I've
  239.           been  doing  with the  aforementioned Ron  Burk  of W/DDJ  in the
  240.           WinHelp area. There, that should get you wondering.
  241.  
  242.                I've been REAL  busy lately with  this and the book,  but it
  243.           looks like  I might be picking up some relief in the near future,
  244.           again, can't discuss it now, but maybe next month.
  245.  
  246.                Things  are looking  good for  Windows NT.  Looks like  it's
  247.           going to  be shipping soon.  If you are a  Windows programmer and
  248.           you have the  hardware, I highly recommend getting  it. If for no
  249.           other reason, it's an incredible Windows development environment.
  250.           I'm  serious, it's NICE. Don't you hate  it when you're testing a
  251.           program, it crashes, and  you have to re-boot? Kiss  that problem
  252.           good-bye.  Under NT, your  program crashes,  and the  session for
  253.           that program  closes. Nothing  else is affected.  Everything else
  254.           works just fine.
  255.  
  256.                Mike took a little flack for his 'review', last month, of an
  257.           OS/2 2.1 review  in a popular  computer magazine.  At the time  I
  258.           agreed with Mike, for the most part. You have  to understand that
  259.           what  we  write in  WPJ.INI  and  the Last  Page  are  not to  be
  260.           construed as fact  or serious (well, sometimes:  I'm dead serious
  261.           about  switching  the magazine  to  every  other month!).  Mike's
  262.           comments such as, "that useless operating system" is not meant to
  263.           mean that OS/2  is useless,  just an expression  that he  doesn't
  264.           like it.
  265.  
  266.                So, as I said, I agreed  with him at the time. Recently I've
  267.           had a chance to use OS/2  2.1 quite a bit. Do I still  agree with
  268.           Mike? Mostly, yes. I  had to install OS/2 2.1 three  times before
  269.           it  would actually let me switch  between OS/2 boot and DOS boot,
  270.           and  back  to OS/2.  The  first  two  installs it  wiped  out  my
  271.           \OS2\SYSTEM  directory in the switch from DOS to OS/2. Now, after
  272.           the third install (we're talking 18 disks and a real slow install
  273.           program), it  works, sort of. It  still locks up quite  a bit. It
  274.  
  275.                                         - 5 -
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282.  
  283.  
  284.  
  285.           took me three re-boots the other day just to get  past my network
  286.           requester startup.
  287.  
  288.                So,  my  opinions? I  don't think  OS/2 2.1  is particularly
  289.           stable. I didn't think OS/2 2.0 was particularly stable either. I
  290.           had many  of the same problems with it. OS/2 2.1 is  signficantly
  291.           faster,  especially   for   running  Windows   Apps,  than   it's
  292.           predecessor,  2.0. Still, as I  said, it's not  very stable. I'll
  293.           admit  this was  a beta,  but let's  compare it  to another  beta
  294.           product, NT.
  295.  
  296.  
  297.                I've  installed all three beta  versions of NT.  Each one, I
  298.           installed once and only  once. Each worked the first time. We did
  299.           have a  small problem with the  October '92 version because  of a
  300.           hardware  conflict which, once we posted a note on CompuServe, we
  301.           received a fix within a few  days. That's not a bad turnaround in
  302.           my  book. Try  getting  IBM to  send  you a  "STABLE"  version of
  303.           OS/2...
  304.  
  305.                As far as OS/2 2.0 and 2.1 performance, I think they are
  306.           both slow, for the most part. When compared with Windows NT,
  307.           there's no comparison. NT is blazing fast. I keep waiting to
  308.           smell smoke coming out of the computer. When OS/2 runs, for one
  309.           thing, just booting up takes forever. Then, when you finally boot
  310.           up, it crawls, even with a machine that is well above the minimum
  311.           requirements.
  312.  
  313.                I  haven't  used  NT with  a  machine  at  the bare  minimum
  314.           requirements, but I've used OS/2 on machines of equal caliber and
  315.           there's no comparison.
  316.  
  317.                Ok,  so let me get my  flack, but that's my PERSONAL opinion
  318.           of  OS/2 as  I have  experienced it. I  know there  are a  lot of
  319.           people out  there that like it.  That's fine, I'm  not hacking on
  320.           you. A lot of people  like Snickers. I don't, but it's  fine with
  321.           me that they do. Understand? I think that was the way Mike wanted
  322.           his article to be viewed. I think he's writing in response to one
  323.           of the letters he got, so you can read that too.  I think this is
  324.           enough about OS/2 for a magazine that doesn't cover it!
  325.  
  326.                On  to other topics, that damn WinHelp file. Well, we've had
  327.           some problems with it in the past,  but I think we're going to be
  328.           past them on  this issue. I say that because  I have been working
  329.           with Ron  Burk and in the process have learned a great deal about
  330.           WinHelp of which I was previously unaware. We'll have the bitmaps
  331.           in this time.  We'll also  have the browse  buttons that we  keep
  332.           getting complaints on. 
  333.  
  334.                                         - 6 -
  335.  
  336.  
  337.  
  338.  
  339.  
  340.  
  341.  
  342.  
  343.                Our deepest thanks to Kerim Erden for a lot of the ideas and
  344.           know-how to produce the WinHelp File. He came up with some really
  345.           great ideas and  showed us  how to implement  them. We're  deeply
  346.           indebted  to him  for  the help.  Hope  everyone enjoys  the  new
  347.           format. So, sit back, fire  up Windows, and check out the  latest
  348.           issue.
  349.  
  350.                Peace.
  351.  
  352.             _Pete Davis
  353.  
  354.  
  355.  
  356.  
  357.  
  358.  
  359.                                         - 7 -
  360.  
  361.  
  362.  
  363.  
  364.  
  365.  
  366.  
  367.  
  368.                                        Letters
  369.  
  370.           Date:  16-May-93 11:49 EDT
  371.           From:  Ian Pawson [100015,1364]
  372.           Subj:  WinStub
  373.  
  374.           Hi,
  375.  
  376.                   I was  interested  to read  the article  on enhancing  the
  377.           WinStub program on page 31 of the May 93 issue.
  378.  
  379.                   To make  this a  truly generic  windows stub,  it needs  a
  380.           couple  of minor modifications to enable it to launch ANY program
  381.           to  which it is attatched.  The spawnlp() function  call needs to
  382.           pass Windows the name of the .exe file so that Windows can run it
  383.           after it has started. This is achieved by  using the argc[0] var.
  384.           (Note  that  argv[0] is  the  full dos  path  name, not  just the
  385.           program name.)
  386.  
  387.           Two lines need to be changed and one added, as shown below:
  388.  
  389.           #pragma argsused
  390.           int main( int argc, char *argv[] )  // get command line
  391.           Parameters
  392.  
  393.           returncode = spawnlp( P_WAIT, "win.com", " ", argv[0], NULL ); 
  394.           // pass filename to Windows
  395.  
  396.                   The  added #pragma command  is just  to stop  the compiler
  397.           complaining that argc is declared, but not used.
  398.  
  399.           Cheers, Ian.
  400.  
  401.           [Thanks for the note, Ian.  Good tip. - Ed.]
  402.  
  403.           ----------------------------------------------
  404.           ------------------------
  405.  
  406.           From: Jeff Miller <jmiller@hp1.terra.colostate.edu>
  407.           Date: Wed, 12 May 93 12:01:01 MDT
  408.  
  409.           I enjoyed your Windows Programmer's Journal, v.1 n.5, but as much
  410.           of a fan of Windows as I am, I feel that your "Last  Page" column
  411.           was misleading.
  412.  
  413.           You  mention reading an article  about OS/2 2.1,  and getting the
  414.           impression  that the author was trying to make OS/2 into Windows.
  415.           Of course  OS/2 isn't Windows,  but just  like Windows NT,  it is
  416.  
  417.                                         - 8 -
  418.  
  419.  
  420.  
  421.  
  422.  
  423.  
  424.  
  425.           Windows  compatible, which  would  make  it  of interest  to  any
  426.           current Windows user.
  427.  
  428.           The first  thing that really got  my attention was when  you call
  429.           OS/2 "that useless operating system".  What is your rationale for
  430.           calling it "useless"?  Have you run  DOS,  Windows  or OS/2  apps
  431.           under OS/2 (even version 2.0?) if you had, I hardly believe you'd
  432.           think OS/2 was "useless".  Next you state that for Windows [under
  433.           OS/2] you  need "a 486 with 12MB of  RAM and a 100MB hard drive".
  434.           First  off, the minimum requirements of OS/2 (at least v2.0) are:
  435.           60MB hard drive, 4MB RAM, 386SX+ processor.  Of course this won't
  436.           be an optimal setup,  but I would  consider this setup a  minimal
  437.           (practical) Windows 3.1 setup.  The last I heard, Windows NT will
  438.           require a  386, 16MB  RAM (that  might have been  for the  beta -
  439.           perhaps it's 8MB? [According to the Microsoft press releases, the
  440.           production version of NT will require 8MB. The beta NT "requires"
  441.           16MB  if you include everything, but this requirement can drop to
  442.           8MB if you remove the networking software. -Ed.]) and 80MB (again
  443.           for the beta, perhaps less on release) for the OS.
  444.  
  445.           You mention that you could run OS/2, but you've opted for Windows
  446.           NT instead. How much space is that operating system  taking?  How
  447.           much RAM  do you have?  What type of  processor do you  have (and
  448.           what speed)?   Have you tried comparing the speed of Windows apps
  449.           under OS/2 vs.  Windows (3.1)  apps under Win  NT? From the  beta
  450.           versions of Win NT I've seen, I'd have to believe that OS/2 would
  451.           be faster.
  452.  
  453.           In closing you  say "If you want to run  Windows, why buy OS/2?".
  454.           I  would  say  because  OS/2  (and Win  NT)  will  give  you more
  455.           performance  and features  out of  that machine  that's currently
  456.           running a DOS  based GUI extender.   Hey,  just try formatting  a
  457.           floppy under Win 3.1 and  doing anything else.  You go  on to say
  458.           "anyone buying OS/2 on  this promise [to run windows  apps better
  459.           than Windows]  will only be disappointed,  I think."   Why?  OS/2
  460.           (v2.1) seems to run Windows  3.1 apps just as if they  were under
  461.           Windows 3.1.   What's disappointing about that?    Lastly you say
  462.           that "an operating system should  be able to stand on what  makes
  463.           it unique,  or it will  end up  being nothing more  than a  cheap
  464.           imitation".  I agree, but this doesn't apply to OS/2. You make it
  465.           sound like all OS/2 does is  run Windows 3.1 and DOS apps  with a
  466.           different  look to  it.   OS/2  as an  operating  system is  very
  467.           powerful,  even   without  the  Win3.1  and   DOS  compatibility.
  468.           Remember that  compatibility doesn't necessarily  mean there's no
  469.           innovation involved.
  470.  
  471.           Well, I  hope I haven't  come off sounding  too harsh.   I _am_ a
  472.           Windows  3.1  user,  but   I  felt  in  fairness  to   OS/2  that
  473.  
  474.                                         - 9 -
  475.  
  476.  
  477.  
  478.  
  479.  
  480.  
  481.  
  482.  
  483.           unsubstantiated claims shouldn't go unchallenged.
  484.  
  485.           Jeff Miller
  486.  
  487.           [Thanks for the letter, Jeff.  I was getting the idea  no one was
  488.           reading the "Last  Page".  I'd  rather get negative mail  than no
  489.           mail  at all.  You had some questions/comments I want to address,
  490.           so here goes:
  491.  
  492.            a) OK, perhaps "useless"  was too strong a term.   My experience
  493.           with  OS/2 has been limited, but  I haven't seen anything to make
  494.           it stand apart from Windows (particularly NT).  My main point  of
  495.           contention is stability - I've heard several horror stories about
  496.           OS/2 2.1  locking up regularly  (see Pete's  "WPJ.INI" column  in
  497.           this month's issue).   Under NT, if a program  crashes, only that
  498.           program  stops  running -  nothing else  is  affected.   The only
  499.           problem  I've  had   with  NT  was  the   NTDETECT.COM  file  was
  500.           incompatible with my monitor. A note posted  on CompuServe netted
  501.           a  new NTDETECT.COM file within a couple  of days and the bug was
  502.           gone.   If you haven't had  problems with OS/2, then  I'm glad to
  503.           hear it.  As a programmer, nothing is more frustrating to me than
  504.           an  OS that  hinders  my productivity.    I  only used  the  word
  505.           "useless"  based on my  own experience with  OS/2.  If  there are
  506.           advantages  to running OS/2 instead  of NT, then  I haven't heard
  507.           them.
  508.  
  509.           b) I'm running Windows NT on a 486/50 with 16MB RAM, and it takes
  510.           up about  72MB (including the 24MB swap  file) on the hard drive.
  511.           Again,  my experience  with OS/2  has been different  than yours.
  512.           I've seen OS/2 on more powerful PCs than the minimum required for
  513.           OS/2,  and it  crawls compared  to NT.   When  I wrote  about the
  514.           minimum  requirements for OS/2 (e.g., 16MB  RAM), I was referring
  515.           to  a practical  setup.   I  apologize for  the misunderstanding.
  516.           I've seen  OS/2 run  on a PC  with a  setup less  than the one  I
  517.           described as  practical, and, to me, it was just unusable when it
  518.           came  to response time.  If your experience  differs, then that's
  519.           great.  I hope other people have had better luck with OS/2 than I
  520.           have.
  521.  
  522.           c)  I  will be  the  first  to admit  that  Windows  3.1 has  its
  523.           limitations. Anything based on an OS as old as DOS will have some
  524.           problems, especially  if you're developing software.   Your point
  525.           about formatting a floppy under 3.1 is  a valid one.  This is why
  526.           I  have NT.   It avoids  DOS problems  such as  the 64K  limit on
  527.           segments.  Sure,  so does OS/2.   But what does it offer  that NT
  528.           doesn't?   You write that OS/2 "...is very powerful, even without
  529.           the  Win3.1 and DOS compatibility."  If  you want to elaborate on
  530.           this, we'll  be glad to print  it.  This brings  up another issue
  531.  
  532.                                         - 10 -
  533.  
  534.  
  535.  
  536.  
  537.  
  538.  
  539.  
  540.           for  programmers: availability of programming aids.  When I go to
  541.           the  bookstore for  help  on  programming  Windows,  there  is  a
  542.           plethora of  choices for me to look at and decide which ones will
  543.           help me the most.  I've looked for books on programming OS/2, and
  544.           I've  rarely seen any.   Since  you read  WPJ, Jeff,  I'll assume
  545.           you're a programmer.  How many book have you seen on writing OS/2
  546.           apps?  I hope you've  had better luck than  me.   One measure  of
  547.           the success of  an operating system should  be the the  amount of
  548.           literature available  on  programming in  it.   This  is  another
  549.           reason I choose Windows (3.1 and NT) over OS/2.
  550.  
  551.           I don't think your  letter was too harsh.  On  the contrary,  I'm
  552.           glad you took  the time to write.   I'm not trying to  preach the
  553.           gospel, just write about my own experiences.  If people are happy
  554.           with OS/2 and they're productive, then  more power to them.  OS/2
  555.           just isn't for me.  If you (or anyone else) has comments about my
  556.           response, then please write.  I hope I've been fair to Jeff in my
  557.           response to  his letter.  If  you disagree, let me  know.  Thanks
  558.           for the letter, Jeff. -Mike]
  559.  
  560.           ------------------------------------------------------------ ----
  561.           -------------------
  562.  
  563.           Hi,
  564.  
  565.           I'm a  novice windows programmer, and  I just wanted to  write to
  566.           you to thank you, and encourage you to continue your efforts, and
  567.           those of your other writers, in the Windows Programmer's Journal.
  568.           It is  quite useful for   people like  me, with columns  for both
  569.           beginners and  advanced programmers.    I'm especially  glad that
  570.           you are expanding the  authorship to include other topics.   Keep
  571.           up the good work!
  572.  
  573.           Thanks
  574.  
  575.           jeff
  576.           perkel_j@a1.mscf.upenn.edu
  577.           71404,123
  578.  
  579.           [Thanks Jeff.  I'm  glad you like the magazine so much.  All past
  580.           and  current authors  should give  themselves a  good pat  on the
  581.           back.  You've  all done a  great job in  helping us put  out this
  582.           magazine every month.  We couldn't have done it without  you.  In
  583.           this month's issue, you may notice an article from  Jeff.  Thanks
  584.           for helping  us out with the article, Jeff. Now, if only we could
  585.           get more people to show us their appreciation for WPJ the way you
  586.           have. - Editor]
  587.  
  588.  
  589.                                         - 11 -
  590.  
  591.  
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.                                   Beginner's Column
  599.                                    By Dave Campbell
  600.  
  601.           Ok, I'm gonna be honest here. It is June 6th, Pete and Mike have
  602.           been very understanding, and I'm late. I've got a diet coke, and
  603.           a bag of cheap donuts, and it's time to go. Don't try this at
  604.           home boys and girls, it should only be done by .... (guess that
  605.           leaves me out).
  606.  
  607.           I promised to put the file dialog from last time into a DLL, and
  608.           I am not going to make it. Instead I am going to answer a couple
  609.           of people's questions about Borland vs Microsoft in terms of make
  610.           files.  The files as I have been submitting them so far have been
  611.           Microsoft compatible (but you Borland turkeys already knew that,
  612.           didn't you?). I am in a sort of enviable position (except for
  613.           disk space) in that I have both compilers at-hand. I started out
  614.           Borland, and will still go that way for expedience, but I am
  615.           trying to become more literate of Microsoft also.
  616.  
  617.           In this month's HELLO.ZIP file, you will find two make files. The
  618.           two are named HELLO.MAK (for Borland), and MHELLO.MAK (for
  619.           Microsoft). This is how I will ship from now on. The syntax for
  620.           executing the make is:
  621.  
  622.           1) Borland
  623.              make -fhello.mak
  624.  
  625.           2) Microsoft
  626.              nmake -fmhello.mak
  627.  
  628.           The Microsoft make file is void of pathspecs and such compared to
  629.           the Borland make file. The reason for this is that the Microsoft
  630.           compiler builds all that stuff into your environment when it
  631.           installs, so my environment contains (amongst other things):
  632.  
  633.              TOOLROOTDIR=E:\MSVC
  634.              INCLUDE=E:\MSVC\INCLUDE;E:\MSVC\MFC\INCLUDE;
  635.              LIB=E:\MSVC\LIB;E:\MSVC\MFC\LIB;
  636.              INIT=E:\MSVC;
  637.  
  638.           This allows the make file to be somewhat more streamlined.
  639.  
  640.  
  641.           Building Make Files
  642.           -----------------------------
  643.  
  644.           If there's one piece of code that could use an entire book
  645.           written just for it, it is the make files. I don't care if you
  646.  
  647.                                         - 12 -
  648.  
  649.  
  650.  
  651.  
  652.  
  653.  
  654.  
  655.  
  656.           are Borland or Microsoft-compatible, they are both confusing. So,
  657.           how do I build them? Simple, I steal them. Honest! (or is that
  658.           Dishonest!?) 
  659.  
  660.           My first choice of a make file was the last one that worked. If
  661.           that isn't possible, and I am using Borland's tools, I get into
  662.           the IDE, select Project/Open, give it a name, and then use the
  663.           Ins key to add the filename.c and filename.rc. Then go to
  664.           Options, and setup a small model Windows EXE file default
  665.           selection, and save everything. I get out of the IDE, and run:
  666.  
  667.              PRJ2MAKE <filename> <filename>
  668.  
  669.           This converts the <filename>.prj file to <filename>.mak that we
  670.           wanted. Once I have a make file, I can modify it like a madman,
  671.           but just getting the first one drives me crazy.
  672.  
  673.           This same technique can be used (sort of) with VC++. The
  674.           difference is that part way through the process, it asks if this
  675.           is to be an external make file, and you say YES.
  676.  
  677.  
  678.           Hello
  679.           --------
  680.  
  681.           I have made some slight changes to hello this time around,
  682.           besides the two make files. I added the items necessary to
  683.           produce 3.0/3.1 files with newer tools:
  684.  
  685.           #define WINVER 0x0300
  686.  
  687.           This line must be before #include'ing windows.h, and:
  688.  
  689.           RC -30 hello.res hello.exe
  690.  
  691.           This is in the make file, and instructs the RC executable that we
  692.           want to execute under both 3.0 and 3.1.
  693.  
  694.           The only other change is the line:
  695.  
  696.           wc.lpfnWndProc = (WNDPROC)WndProc;
  697.  
  698.           in the InitInstance function. This fully qualifies the WndProc
  699.           pointer by casting it correctly.
  700.  
  701.  
  702.           Tease
  703.           ----------
  704.  
  705.                                         - 13 -
  706.  
  707.  
  708.  
  709.  
  710.  
  711.  
  712.  
  713.           I must apologise for a short article, but as you can see, I am
  714.           late, and have been jammed all month. Next month we'll continue
  715.           with hello.c and the DLL carry-over from last month.
  716.  
  717.           In addition, next month I'll explain the code I put into hello
  718.           this month. I quickly coded up a surprise that will  lead into a 
  719.           in addition to the Beginner's Column. I'm not going to discuss it
  720.           here, you have to find it, and execute the code to see what I've
  721.           done.
  722.  
  723.           Have fun, and enjoy the code!!
  724.  
  725.  
  726.           EndDialog
  727.           ----------------
  728.  
  729.           Another month down the tubes, so to speak, but before I go I do
  730.           want to mention one thing. It is my opinion that any code I put
  731.           in this magazine is in the public domain as of the time Pete and
  732.           Mike post it. I pull code from books and magazines, and anywhere
  733.           else I can find it to save me time and get a job out quicker, and
  734.           I am not about to put any restrictions on anything I talk about
  735.           here. That's all.
  736.  
  737.           Next month, we do the DLL, so watch for us. Feel free to contact
  738.           me in any of the ways below.  Thanks to those of you that have e-
  739.           mailed me questions, keep them coming.  Notice that I now have an
  740.           internet address, to make it real easy to get in touch with me. I
  741.           want to rat out the things other people are having questions
  742.           about, not just what I think people want to hear.
  743.  
  744.           Dave Campbell
  745.              WynApse PO Box 86247 Phoenix, AZ 85080-6247 (602)863-0411    
  746.              wynapse@indirect.com
  747.              CIS: 72251,445
  748.              Phoenix ACM BBS (602) 970-0474 - WynApse SoftWare forum
  749.  
  750.  
  751.  
  752.  
  753.  
  754.  
  755.  
  756.  
  757.  
  758.  
  759.  
  760.  
  761.  
  762.                                         - 14 -
  763.  
  764.  
  765.  
  766.  
  767.  
  768.  
  769.  
  770.                                    Internally Yours
  771.                                     By Pete Davis
  772.  
  773.              It's about time we had another book review, and every once in
  774.           a while a book comes by that I can't wait to review. Windows                                                               Windows                                                               _______
  775.           Internals by Matt Pietrek is just such a book. This book is          Internals          _________
  776.           published by Addison-Wesley and is the latest in the Andrew
  777.           Schulman Programming Series. You might think I'm a little biased
  778.           since my book will be in the same series. I can't exactly deny
  779.           that, but I try to be objective when doing book reviews.
  780.  
  781.              I have been waiting a long time for this book to show up and I
  782.           have to say that I'm not disappointed at all. Windows Internals                                                        Windows Internals                                                        _________________
  783.           provides a view at the inner workings of Windows that you won't
  784.           find anywhere else, unless you work for Microsoft and have the
  785.           source code., of course. To write the book Mr. Pietrek reverse-
  786.           engineered many different parts of Windows. From the disassembly
  787.           he has managed to create C-like pseudo code to show how the
  788.           different routines inside Windows work.
  789.  
  790.              One of the things Mr. Pietrek discusses early on is how easy
  791.           it is for one to forget that WIndows is nothing more than a
  792.           program or, more accurately, a collection of programs. There's no
  793.           magic involved. When it comes down to it, the different parts of
  794.           Windows are simply routines that perform operations, just like
  795.           any other program.
  796.  
  797.              The main purpose of this book is to provide an understanding
  798.           of how things work under the hood, as opposed to providing some
  799.           sort of direct programming aid. The idea is that if you
  800.           understand how things work internally, you'll understand why a
  801.           function works the way it does.
  802.  
  803.              Chapter 1 is entitled "The Big Bang" and covers the startup
  804.           and shutdown processes of Windows.  From WIN.COM to exiting
  805.           Kernel and dropping back into DOS(without all the stuff in-
  806.           between, actually), you see what Windows is doing to create its
  807.           environment. There's some really good information in here that
  808.           lets you clearly see how Windows is really a DOS extender with a
  809.           GUI wrapping. All of the pseudo code is clear and well
  810.           documented.
  811.  
  812.              Chapter 2, "Windows Memory Management", will have a bit of a
  813.           broader appeal to most of you. Chapter 2 begins with a
  814.           description, in brutal detail, how the selector functions work.
  815.           As selectors are the basis for the Local and Global memory
  816.           mangement routines, it provides a strong foundation for the
  817.           information which follows, the Local and Global memory management
  818.  
  819.                                         - 15 -
  820.  
  821.  
  822.  
  823.  
  824.  
  825.  
  826.  
  827.           functions, of course. I believe there is pseudo code for EVERY
  828.           Global and Local function, including many of the lower-level
  829.           functions (unavailable to the Windows programmer) used by the
  830.           Global and Local functions.  If Mr. Pietrek missed any, you'd be
  831.           hard-pressed to find them. This is the information that I found
  832.           most useful. It really gives you a good feel for Windows as a DOS
  833.           extender.
  834.  
  835.              Chapter 3, "Starting a Process: Modules and Tasks", again,
  836.           goes into gory  detail, this time on how programs are loaded and
  837.           run by Windows. In addition, he also covers the loading and
  838.           execution of Win32s programs under Windows 3.1. Another very
  839.           thorough and informative set of functions in pseudo-code.
  840.  
  841.              Chapter 4, "The Windowing System", is what I considered the
  842.           second most important chapter. You need to keep in mind that
  843.           everything on the screen in Windows is a Window (just about). A
  844.           button is a window, as is a scroll bar or a dialog box. Keeping
  845.           that in mind, the chapter explains how the windows are kept in
  846.           memory, how they are displayed, etc. Many useful functions are
  847.           pseudo-coded.
  848.  
  849.              I must admit I haven't given chapter 5, "The Graphics Device
  850.           Driver Interface", the attention it deserves, yet. It covers
  851.           selected GDI functions such as CreateDC, CreateBrush, etc. There
  852.           enough of it to keep you busy, if that's your cup of tea.
  853.  
  854.              Chapter 6, "The Windows Scheduler", is another favorite of
  855.           mine. This has some fantastic information on how tasks are
  856.           scheduled and prioritized. I personally have quite an interest in
  857.           task management, so I really spent some time here. I, personally,
  858.           would have preferred a little more in this chapter, but that is a
  859.           personal preference.
  860.  
  861.              Chapter 7, "The Windows Messaging System", is another
  862.           important chapter. Messages are the heart of Windows programs.
  863.           Understanding how messages and message queues work at a lower
  864.           level gives a lot of real insight into how Windows programs will
  865.           react in different situations.
  866.  
  867.              The last chapter, "Dynamic Linking" is a bit shorter than I
  868.           would have expected, but in retrospect, I can't think what I
  869.           would have added. Again, painful detail is the name of the game.
  870.  
  871.              Ok, I admit it, I liked this book a lot. I know it might be
  872.           hard to see me as objective, when reviewing a book in this
  873.           series, but I think that under any circumstances I would feel the
  874.           same about this book. It's well organized, extremely detailed,
  875.  
  876.                                         - 16 -
  877.  
  878.  
  879.  
  880.  
  881.  
  882.  
  883.  
  884.           and covers most of the major areas you'd expect to be covered.
  885.           There is a hint of a second book on Windows Internals. I see this
  886.           as a fix for the one problem the book has, it doesn't have
  887.           everything. It would probably take more than two books to cover
  888.           ALL of Windows, but two should cover just about all of the most
  889.           important areas.
  890.  
  891.              I recommend this book highly to anyone doing Windows
  892.           programming. This book gets into the nitty-gritty details of
  893.           implementation. It's not light or easy reading, but it provides a
  894.           solid understanding of how Windows works under the hood. Any
  895.           programmer who's had to wonder why Windows did something in one
  896.           circumstance and not in another will probably find either the
  897.           answer or some good clues in this book. Again, I recommend it
  898.           highly. Go to your local book store and check out a few chapters.
  899.           If you can understand it, then you'll want to get it, trust me.
  900.  
  901.  
  902.  
  903.  
  904.  
  905.  
  906.  
  907.  
  908.  
  909.  
  910.  
  911.  
  912.  
  913.  
  914.  
  915.  
  916.  
  917.  
  918.  
  919.  
  920.  
  921.  
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928.  
  929.  
  930.  
  931.  
  932.  
  933.                                         - 17 -
  934.  
  935.  
  936.  
  937.  
  938.  
  939.  
  940.  
  941.                                   Pascal in 21 Steps
  942.                   (A Beginner's Column for Turbo Pascal for Windows)
  943.                                     By Bill Lenson
  944.  
  945.           Step One - Fundamentals
  946.           (or, "you can't get by without this stuff")
  947.  
  948.           OK, here we go.  Last month we talked about what to expect from
  949.           this Pascal column.  In brief, this is going to be a crash course
  950.           designed to introduce any devoted reader to the fundamentals of
  951.           programming Borland Pascal for Windows.  At the end of this
  952.           months column you should be able to write a simple program to
  953.           display a calculation to the screen, know what a program is, what
  954.           a variable is, and what some common data types are.
  955.  
  956.           Try not to get too hung up on one or two concepts you may not
  957.           understand the first time.  Read this through once and follow the
  958.           instructions.  If it's not clear, read it through again until you
  959.           master the problem. Sometimes understanding just 'how' to do
  960.           something is better initially and then the 'why' gets solved by
  961.           itself later.  This first column may seem a little wordy but I
  962.           think it needs to be to make sure everyone understands the
  963.           basics.  Future columns will progress much quicker.
  964.  
  965.           If you have any ideas for future directions with this column, or
  966.           any comments and have access to e-mail on a Bulletin Board,
  967.           please send them to me at the address at the end of this article. 
  968.           Thanks in advance!
  969.  
  970.           Where to begin?  Ah yes, the beginning.
  971.  
  972.  
  973.           1) A Very Brief History of Pascal
  974.  
  975.           Pascal is one of several hundred "languages" you use to talk to a
  976.           computer.  Originally it was designed as a learning tool by a
  977.           Swiss Professor of Computer Science by the name of Nicklaus
  978.           Wirth.  It seemed that other languages had too many barriers for
  979.           his students to easily learn fundamental computer concepts. 
  980.           These computer concepts are called Data Structures and
  981.           Algorithms.  We'll talk more about what these are in a later
  982.           column.  As an aside, one of Nicklaus' early students later went
  983.           on to write his own adaptation of Pascal.  That person is
  984.           Philippe Kahn, founder and CEO of Borland Corporation, and his
  985.           Pascal extension is, of course, Turbo Pascal.
  986.  
  987.           OK, we know Pascal is a language which we use to talk to the
  988.           computer.  Why not just talk to the computer in English. 
  989.  
  990.                                         - 18 -
  991.  
  992.  
  993.  
  994.  
  995.  
  996.  
  997.  
  998.           Frankly, it's too difficult to do efficient "natural language"
  999.           processing (although this is one of the hottest topics in
  1000.           Universities today).  English has thousands of  words with
  1001.           multiple meanings for each so we settle for Pascal with it's
  1002.           fifty or so common words in it's language.  How you compose a
  1003.           program is the topic you will be studying from now on.
  1004.  
  1005.           2) Programs
  1006.  
  1007.           The Pascal language is concise.  We only need to type one or two
  1008.           words to get our point across and instruct the computer to carry
  1009.           out our wishes.  For instance we can write some text on the
  1010.           screen or read numbers we type from the keyboard.  But what is a
  1011.           program and how does the computer understand it?
  1012.  
  1013.           Programs are just a series of instructions written out in a text
  1014.           file.  Borland Pascal comes with a text file editor which you
  1015.           should use to type in your programs.  After typing them in you
  1016.           can save them to disk just like a letter in a word processor. 
  1017.           The Borland manuals and online help will give you plenty of help
  1018.           with the editor and how to use it.
  1019.  
  1020.           Now, you have a program, so how does the computer know how to
  1021.           execute the instructions written out in that file?  It doesn't
  1022.           yet because (don't worry I'll explain this) computers don't
  1023.           understand Pascal.  Computers only understand one language known
  1024.           as machine language.  Machine language is very powerful but very
  1025.           difficult to learn.  What you can say with one instruction in
  1026.           Pascal could take 100 instructions in machine language.  Now
  1027.           we're still left with a problem:  we write programs in the Pascal
  1028.           language but the computer only understands machine language. 
  1029.           What do we do?  And the answer is - Borland Pascal comes with a
  1030.           translator which will convert Pascal to machine language.  It
  1031.           will even tell you if your program isn't written properly (at
  1032.           least it will find spelling mistakes). This magical translator is
  1033.           called a compiler.  And what a compiler!  Borland Pascal's
  1034.           compiler will translate up to 85,000 lines of Pascal code to
  1035.           machine language in one minute.
  1036.  
  1037.           The Borland Environment is complete.  You can compose your
  1038.           programs using the editor, compile them to machine language using
  1039.           the compiler, and it will let you execute the program and tell
  1040.           you where problems are.  The compiler will even make an EXE file
  1041.           so you can run it at any time.  There's even a debugger built in. 
  1042.           A debugger is a program used to help you find potential problems
  1043.           in your program.  Here's goes another tangent...  The term bug
  1044.           actually dates back to the 1950's when an early computer suddenly
  1045.           stopped executing a small program it was running.  When the
  1046.  
  1047.                                         - 19 -
  1048.  
  1049.  
  1050.  
  1051.  
  1052.  
  1053.  
  1054.  
  1055.           researchers opened up the back and looked at the mounds of wires
  1056.           and vacuum tubes, they discovered a moth had flown in and shorted
  1057.           it out.  From this time forward, whenever a program "crashes" or
  1058.           does something unexpected, it is said to have a bug in it
  1059.           somewhere.
  1060.            
  1061.  
  1062.           3) The Underlying Idea Behind Programming
  1063.  
  1064.           The idea behind writing a program is relatively simple.  You
  1065.           aren't really programming a computer, you're controlling the
  1066.           devices and memory that make up a computer.  Whether you program
  1067.           for DOS or Windows, the idea is the same.  All too often,
  1068.           programmers forget this and find themselves writing code that is
  1069.           just plain crazy.
  1070.  
  1071.           So what are the devices?  Well, there are input devices which
  1072.           supply data to your computer and output devices which do
  1073.           something with data coming from your computer.  Examples of input
  1074.           devices are:  keyboard and mouse.  Examples of output devices
  1075.           are:  display and printer.
  1076.  
  1077.           Memory is a little different.  I like to group memory into two
  1078.           categories.  First there is RAM which acts like a temporary
  1079.           storage for numbers like a memory on a calculator.  The
  1080.           difference is that calculators usually only store a few numbers,
  1081.           RAM can store thousands if not millions of numbers.  Like
  1082.           calculators, RAM gets erased when you turn your machine off.  The
  1083.           other type of memory is a more permanent store, the disk.  This
  1084.           can be a floppy diskette or a hard disk.  You can write to and
  1085.           read from disks just like you can from RAM but data on disks are
  1086.           persistent (doesn't go away when you turn your computer off, only
  1087.           when you explicitly erase it).  For sake of clarity, I'll call
  1088.           "RAM" memory and "disks" disks.
  1089.  
  1090.           Behind all this is the controller, the thing you talk to to get
  1091.           things done, the thing that processes all your commands, the
  1092.           Central Processor Unit (CPU).  The CPU reads instructions one
  1093.           after another and carries out what they're supposed to do.  Some
  1094.           instructions read input, some write output, some read or write
  1095.           from the disk drive, and some manipulate data we store in the
  1096.           RAM.  What's important is programs are usually driven by taking
  1097.           input from the user and storing the information in RAM,
  1098.           performing some calculations on the data, and either store the
  1099.           results on a diskette for later use or display the results on an
  1100.           output device.  This can be illustrated by the old-faithful
  1101.           computer drawing:
  1102.  
  1103.  
  1104.                                         - 20 -
  1105.  
  1106.  
  1107.  
  1108.  
  1109.  
  1110.  
  1111.  
  1112.                                     +-----------+
  1113.                                     |   RAM     |
  1114.                                     |           |
  1115.                                     +-----------+
  1116.                                           /\
  1117.                                           ||
  1118.                                           \/
  1119.                 +-----------+       +-----------+      +-------------+
  1120.                 |  Input    |------>|   CPU     |----->|    Output   |
  1121.                 | Device    |       |           |      |     Device  |
  1122.                 +-----------+       +-----------+      +-------------+
  1123.                                           /\
  1124.                                           ||
  1125.                                           \/
  1126.                                     +-----------+
  1127.                                     |  Disk     |
  1128.                                     |  Drive    |
  1129.                                     +-----------+
  1130.  
  1131.  
  1132.                       Fig. 1) Typical Flow of Data in a Computer
  1133.  
  1134.  
  1135.           It may not become apparent how important this drawing is right
  1136.           now but when you get better at programming you'll realize that
  1137.           each block is a major area of study.  Input and output device
  1138.           control should be fairly obvious - you want the most efficient
  1139.           and user friendly inputs and the clearest, most user friendly
  1140.           output.  RAM study focuses on Data Structures which are different
  1141.           ways to think of data stored in the RAM while running your
  1142.           program.  Disk drive study is the study of database design.  No
  1143.           matter if you're saving a mailing list, word processor letters,
  1144.           or EXEcutable files, a disk drive can be thought of as a filing
  1145.           cabinet.  How you organize those files is the real trick.  When
  1146.           you can successfully control each of these and have your program
  1147.           perform something of value, then you've learned to program. 
  1148.  
  1149.           OK, enough of sounding like Master Po from Kung Fu.  Let's get
  1150.           down to the real stuff - writing a program.
  1151.  
  1152.  
  1153.           4)  Writing Your First Program - Hello world.
  1154.  
  1155.           So, now you're armed with the compiler and editor waiting to
  1156.           blast away at the first program.  Good!  I'm assuming you are
  1157.           using Borland Pascal for Windows and you have it loaded up on the
  1158.           screen.  The first thing you'll need to do is change some
  1159.           environment Options to make sure what I tell you will work.
  1160.  
  1161.                                         - 21 -
  1162.  
  1163.  
  1164.  
  1165.  
  1166.  
  1167.  
  1168.  
  1169.           Click on Options, then Environment, then Preferences.  Click on
  1170.           the field that says Alternate in the top right corner.  This
  1171.           ensures the keyboard presses I do will function the same for you
  1172.           (for example, F3 will load a program and F2 will save it to disk
  1173.           now).  Click OK.  Click Options, Environment, then Editor and
  1174.           change Tab Size to be 4.  I believe TAB will be set to 8 spaces
  1175.           by default.  Click OK.  Click the Options menu option one more
  1176.           time and then Click on Save.  You're now set up with the same
  1177.           basic editor options as me.
  1178.            
  1179.           To write your first program press F3.  A file open dialog box
  1180.           should appear.  Type EX1 and press Enter.  You have just created
  1181.           a blank file called EX1.PAS which is stored on the disk.  The
  1182.           editor is now opened up and waiting for you to type in your
  1183.           program.  Type the following EXACTLY!
  1184.  
  1185.  
  1186.                   program HELLO_WORLD;
  1187.                   uses WINCRT;
  1188.                   begin
  1189.                      writeln('Hello, World');
  1190.                   end.
  1191.  
  1192.  
  1193.           When this is entered, press F2 to save it to disk.  Now hold down
  1194.           the Ctrl key and then press F9.  If you typed everything
  1195.           correctly you should see a window appear on the screen with the
  1196.           words Hello, World written in the top left corner.  If you didn't
  1197.           get everything quite right, you will probably get an Undefined
  1198.           Identifier message which just means you spelled something wrong. 
  1199.           The editor will even highlight the line that has a problem. 
  1200.           Compare your program with mine in that case.  To close the
  1201.           window, double-click the mouse on the close box in the top left
  1202.           corner of the window you just created.
  1203.  
  1204.           Your first program!  Well done!
  1205.  
  1206.           OK, it's not much but it's a start.  But what does it mean? 
  1207.           Funny you should ask...  There are several things I should point
  1208.           out about this program before we go on.
  1209.  
  1210.           Every program is made up of a series of statements.  Statements
  1211.           end in a semi-colon (;) and are kind of like a sentence in
  1212.           English.  The compiler will translate each statement one by one. 
  1213.           In the program above there are three statements.  Begin and End
  1214.           act like book-ends and surround instructions of actions to carry
  1215.           out.  In this program, there is only one instruction (
  1216.           writeln('Hello, World'); ).  The last End in a program always has
  1217.  
  1218.                                         - 22 -
  1219.  
  1220.  
  1221.  
  1222.  
  1223.  
  1224.  
  1225.  
  1226.           a period after it.  Other Ends, if present, usually have a semi-
  1227.           colon instead.
  1228.  
  1229.           The first line of a program is really just for information
  1230.           purposes and gives a one word description of what the program
  1231.           does.  Notice I said one word.  That's why it's spelled
  1232.           HELLO_WORLD, not HELLO WORLD.  The underline tricks the compiler
  1233.           into treating it as one word.  Another term you might hear every
  1234.           now and then is identifier.  An identifier is often used to
  1235.           describe words you make up and place in programs.  HELLO_WORLD is
  1236.           something we made up.  We could just as easily have put
  1237.           THE_FIRST_ONE, or EXAMPLE1.  Program is part of the Pascal
  1238.           language so we usually don't call it an "identifier".  We call
  1239.           words that are part of the  language "reserved words".
  1240.  
  1241.           The second statement, USES WINCRT;, well, let's leave that one
  1242.           for later.
  1243.  
  1244.           As we said above, the Begin and End surround a group of
  1245.           instructions.  In the future we'll have many more instructions
  1246.           inserted where our one lonely writeln instruction (pronounced
  1247.           "write line") is now.
  1248.  
  1249.           Our first program deals with two of the blocks in the diagram
  1250.           above:  CPU and an Output device (Window on the screen).  The CPU
  1251.           was used to execute the instruction.  Now we'll turn our
  1252.           attention to memory and talk a little bit about variables.
  1253.  
  1254.  
  1255.           5) The Second Program - Hello World 2.
  1256.  
  1257.           Any program of significance is made up of two parts, instructions
  1258.           and memory storage.  The number of instructions that manipulate
  1259.           memory far outnumber the number that control devices and disks. 
  1260.           We better talk about memory and variables before we go too far.
  1261.  
  1262.           Machine language programmers often think of memory as a long
  1263.           string of millions of bytes (MegaBytes).  Pascal treats memory
  1264.           more abstractly as small chunks.  Each chunk can store different
  1265.           types of data such as numbers or strings of characters (letters,
  1266.           numbers, symbols).  In Pascal, we call the chunk a variable.  We
  1267.           don't care where in memory a variable is located or how big it
  1268.           is.  We tell the compiler we want a variable that will hold a
  1269.           number 4 digits wide (for example), and it sets aside a section
  1270.           of memory for our use that is big enough for that number.  So we
  1271.           can refer to variables in our program, we give them names. Some
  1272.           examples of reserving variables are:
  1273.  
  1274.  
  1275.                                         - 23 -
  1276.  
  1277.  
  1278.  
  1279.  
  1280.  
  1281.  
  1282.  
  1283.           x    : integer;
  1284.           ch   : char;
  1285.           name : string;
  1286.  
  1287.           These are three variable declarations telling the compiler to
  1288.           reserve three distinct chunks of memory.  The first variable, x,
  1289.           will hold integer numbers. We say that x is a variable which can
  1290.           store a data type of integer.  The next one, ch, is a character
  1291.           type variable and will hold a single character (letter, number (0
  1292.           to 9), or symbol).  The last variable is a string var (variable)
  1293.           called name which can hold up to 255 characters.  From its name,
  1294.           'name', we can probably conclude it will be used for storing
  1295.           somebody's name for later processing.
  1296.  
  1297.           Integer, String, and char are three of Pascal's pre-defined  data
  1298.           types.  There are others, which we'll study in time, that reserve
  1299.           chunks of memory too.
  1300.  
  1301.           How do we put variables into a program and where?  Pascal needs
  1302.           to know about variables and their types before the instructions
  1303.           can execute them. We therefore declare them to the compiler,
  1304.           before the begin, in a 'var' section.  Here's an example to
  1305.           illustrate variables better.  To type this in, press F3, type EX2
  1306.           and press the Enter key.
  1307.  
  1308.  
  1309.                   program HELLO_WORLD_2;
  1310.                   uses WINCRT;
  1311.                   var
  1312.                      s : string;
  1313.                   begin
  1314.                      s := 'Hello, World';
  1315.                      writeln(s);
  1316.                      s := 'From Bill';
  1317.                      writeln(s);
  1318.                   end.
  1319.  
  1320.  
  1321.           Don't forget to press F2 when done typing this program to save it
  1322.           to disk.
  1323.  
  1324.           In the above, var starts a series of variable declarations. 
  1325.           Another way you can think of a variable is like a box.  You can
  1326.           put one thing in the box and then take it out but only one thing
  1327.           can be in the box at one time. Also, the box can contain only one
  1328.           kind of data.  From the program above, we see a variable called s
  1329.           that can hold a string of up to 255 characters. 
  1330.  
  1331.  
  1332.                                         - 24 -
  1333.  
  1334.  
  1335.  
  1336.  
  1337.  
  1338.  
  1339.  
  1340.           The first instruction is called an assignment statement.  ':='
  1341.           (pronounced "assign") means take what's to the right and move it
  1342.           into the variable on the left.  I could have more easily written
  1343.           the instructions as:
  1344.  
  1345.           begin
  1346.              writeln('Hello, World');
  1347.              writeln('From Bill');
  1348.           end.
  1349.  
  1350.           but this seemed like more fun and I could explain variables along
  1351.           the way.  So, the first instruction moves the string into the
  1352.           string variable.  The second instruction writes the string to the
  1353.           screen and then moves the cursor to the beginning of the next
  1354.           line.  s then gets assigned a different value, 'From Bill',
  1355.           erasing the previous contents.  It too gets displayed in the
  1356.           window.  Before you run this program, what do you think the
  1357.           output will be?  Try the program and see if you were right.
  1358.            
  1359.  
  1360.           6)  Conclusion
  1361.  
  1362.           There you have it.  You should be able to now look at sample
  1363.           programs and at least spot the variables and the main Begin...End
  1364.           statements at the bottom of the program file.  The function of
  1365.           the programs might be a little advanced yet but this will soon
  1366.           change.
  1367.  
  1368.           Next month things really start to fly.  You'll learn more about
  1369.           variables, data types, functions, procedures, and units.
  1370.  
  1371.           See you next month!
  1372.  
  1373.  
  1374.  
  1375.           7)  How to Contact Me
  1376.  
  1377.           Please don't try to contact me for programming problems.  I have
  1378.           a full time job and won't have time to respond.  If, however, you
  1379.           would like to send me comments or suggestions for future columns,
  1380.           I can be reached the following ways:
  1381.  
  1382.           a) From CompuServe
  1383.  
  1384.              - Type GO MAIL
  1385.              - Enter your message
  1386.              - When done and prompted for the mailing address put:
  1387.  
  1388.  
  1389.                                         - 25 -
  1390.  
  1391.  
  1392.  
  1393.  
  1394.  
  1395.  
  1396.  
  1397.                               >INTERNET:Bill.Lenson%canrem@uunet.ca
  1398.  
  1399.              - The address must be entered EXACTLY as shown.  Any character
  1400.           left off will cause the message to be sent but won't get to me.
  1401.  
  1402.  
  1403.           b) From a Bulletin Board with Internet Access
  1404.  
  1405.              A surprising number of BBS's have Internet access.  If you
  1406.           have a local mail system, there's a good chance it could also
  1407.           have a "gateway" to Internet.
  1408.  
  1409.              - Contact your BBS Sysop or mail administrator to find out how
  1410.           to send mail through Internet.
  1411.              - Address your message to:
  1412.  
  1413.                   Bill.Lenson%canrem@uunet.ca
  1414.  
  1415.  
  1416.           c) From a BBS with FidoNet Access
  1417.  
  1418.              - Contact your BBS Sysop to find out how to send mail  through
  1419.           FidoNet.
  1420.              - Address your message to:
  1421.  
  1422.                   Bill.Lenson@f15.n229.z1.fidonet.org
  1423.  
  1424.  
  1425.              Please note that in the three addresses given above, there are
  1426.           NO spaces embedded anywhere in them.  It's one character after
  1427.           another.
  1428.  
  1429.              There are several mail systems which can send mail through
  1430.           Internet.  If you are on any of the following systems you MAY
  1431.           have access:  AppleLink, AT&T Mail, Bitnet, BIX, BMUG,
  1432.           CompuServe, Connect, Easynet, Envoy, FidoNet, GeoNet, MCIMail,
  1433.           MFENet, NasaMail, PeaceNet, SIGNet(through FidoNet), SINET, SPAN,
  1434.           SprintMail, THENET, or UNINet.  Contact your mail administrator
  1435.           to see if you can mail through Internet.  If so, drop a message
  1436.           and your comments will be considered for future columns.
  1437.  
  1438.  
  1439.  
  1440.  
  1441.  
  1442.  
  1443.  
  1444.  
  1445.  
  1446.                                         - 26 -
  1447.  
  1448.  
  1449.  
  1450.  
  1451.  
  1452.  
  1453.  
  1454.                  Moving Away from Moving into Windows NT Programming                                  Moving into Windows NT Programming                                  __________________________________
  1455.                                     By Pete Davis
  1456.  
  1457.              Boy, I'm really going to sound biased this month. I can see
  1458.           the flames from here. In my review of Windows Internals I had                                                Windows Internals                                                _________________
  1459.           nothing but good things to say. This review is of the book Moving                                                                     Moving                                                                     ______
  1460.           into Windows NT Programming published by SAMS Publishing and          into Windows NT Programming          ___________________________
  1461.           written by Jason Loveman.
  1462.  
  1463.              First of all, I must give Mr. Loveman some credit. His book is
  1464.           the first real Windows NT programming book to come out (that I've
  1465.           seen), so he really had his work cut out for him. Also, the book
  1466.           was finished only weeks after the third beta release of Windows
  1467.           NT, so the book can sort of be considered a "beta" book. As soon
  1468.           as I started looking through it, there was one thing that stuck
  1469.           out really bad to me and left a real bad taste in my mouth. About
  1470.           1/6 of the book is devoted to a chapter called "A Port of WINIO."
  1471.           WINIO, for those of you not familiar with it, is an API to allow
  1472.           programmers to perform console-type operations (printf and the
  1473.           like) under Windows. In addition it allows you to structure your
  1474.           programs more like DOS or Unix C programs with a main() function.
  1475.           Well, that sounds good, so why would that leave a bad taste in my
  1476.           mouth? The authors of WINIO are David Maxey and Andrew Schulman,
  1477.           for one. Not Jason Loveman. Again, I tried to be objective,
  1478.           though, and bought the book anyway. I started reading that one
  1479.           chapter, just to see if I could find a justification, not for
  1480.           having it, but devoting 1/6 of the book to it.
  1481.  
  1482.              After reading a few paragraphs here and there, it quickly
  1483.           became clear that the only true purpose WINIO served was to give
  1484.           the author the pages he needed to finish the book. To quote the
  1485.           author, "Changing all the code to bring up a simple WINIO
  1486.           application ... took about 20 minutes ..." I'm sorry, did you say
  1487.           55 pages (the number of pages required for the dump of the WINIO
  1488.           code) took you as long as 20 whole minutes? "Actually, there
  1489.           wasn't much work at all.", he says. Well, really, and that was
  1490.           worth 55 pages? I'm sorry folks, but I paid $40.00 for this book
  1491.           and I'm saying, if it's not much work to do this 55 page sample                                                           55 page 
  1492.           port, perhaps it wasn't the best example. In fact, he says that
  1493.           most programs would have a little more work involved. It seems to
  1494.           me that maybe one of these 'other' program would have been a
  1495.           better example. Ok, but enough of that. Let's look at the book
  1496.           and pretend that chapter doesn't exist.
  1497.  
  1498.              The main focus of the book is porting existing Windows 3.x
  1499.           code to the Win32 API. It also stresses portable replacement of
  1500.           code as opposed to simply modifying the code to be Win32
  1501.           compatible. These are good goals and the author makes it clear
  1502.  
  1503.                                         - 27 -
  1504.  
  1505.  
  1506.  
  1507.  
  1508.  
  1509.  
  1510.  
  1511.           that these are goals. The 1st, 3rd, and 4th chapters do a
  1512.           reasonably good job of this, though the 4th is simply the WINIO
  1513.           port. Oops, I was going to forget about  that, wasn't I.
  1514.            disappointed by this chapter. The author skims over the sections
  1515.           on Threads and Synchronization. I know, I'm kinda big on these
  1516.           topics, but I feel they are very important topics and they're
  1517.           probably going to be the two toughest problems for most Windows
  1518.           3.x programmers to overcome when going to NT, at least, that's my
  1519.           opinion. Unless you've used threads before, there's a lot to
  1520.           learn. I think it is unreasonable to assume the reader of this
  1521.           book is going to have a working knowledge of threads and
  1522.           synchronization. There also doesn't appear to be any real
  1523.           organization to the chapter. First he talks about Objects, then
  1524.           DLLs, then Process synchronization, then on to InterProcess
  1525.           Communication (DDEML in particular), and then, whoah,
  1526.           Asynchronous Objects where he covers more about synchronization
  1527.           objects. It seems to be a sort of mish-mash of different topics
  1528.           without any sort of cohesive theme.
  1529.  
  1530.              Chapter 6 is titled, "The NT is for New Technology". It's more
  1531.           like "the NT means I have 'No Title' better than this". The title
  1532.           gives no insight into the contents which, again, is a bunch of
  1533.           unrelated topics that could be either here or in chapter 5 and
  1534.           you wouldn't notice the difference.
  1535.  
  1536.              Chapter 7 is titled, simply "Win32s". Believe it or not, I
  1537.           actually enjoyed this chapter. There was some really good
  1538.           information about Win32s and how it relates to Win32. In
  1539.           particular, he covers areas where they are different. This is
  1540.           useful information and it is well presented.
  1541.  
  1542.              Chapter 8, "Portability" started off well. The first 8 pages
  1543.           discussed important portability questions. This is then followed
  1544.           by a sample program using the MFC libraries. The purpose, being
  1545.           to demonstrate MFC. I have nothing against MFC, but, again, it
  1546.           just sort of sticks out after the first 8 pages and seems oddly
  1547.           placed.
  1548.  
  1549.              Chapter 9, "Tools" is a fairly mediocre discussion of the
  1550.           compiler options, linker, etc. Nothing really earth shaking.
  1551.  
  1552.              Ok, I'm sure I'm going to get some serious heat for being so
  1553.           biased on this review. Different publishing house, doing a book
  1554.           on the same topic that my book will be on (sort of, not exactly).
  1555.           Really, when some more books come out, I can almost guarantee
  1556.           that I'll bring some up that are really good books and I'll be
  1557.           objective about them. I've tried to be objective about this book.
  1558.           It's hard to feel objective when you feel like you got burned,
  1559.  
  1560.                                         - 28 -
  1561.  
  1562.  
  1563.  
  1564.  
  1565.  
  1566.  
  1567.  
  1568.           though.
  1569.  
  1570.              The overall appearance of the book shows signs of average
  1571.           writing. There are a lot of editing errors that also stick out.
  1572.           There are sentences that I thought didn't make sense the first
  1573.           time and never made sense after that either. The organization of
  1574.           the book doesn't seem to be very well thought-out. There appear
  1575.           to be a lot of sections of unrelated topics thrown in together.
  1576.           The book's initial goals seem to sort of get lost after the first
  1577.           few chapters.
  1578.  
  1579.              The book does have its good points. It does have some good
  1580.           information on porting existing code from Windows 3.x to Windows
  1581.           NT. The problem is, I've seen an equal job done in Microsoft's
  1582.           documentation. There's not $40.00 worth of new porting
  1583.           information.
  1584.  
  1585.              I cannot recommend this book. I will admit my expectations
  1586.           have been a little high for the first Window NT/Win32 programming
  1587.           books. I wanted to see some good writing. I like a good
  1588.           programming book as much as the next nerd. Unfortunately, I don't
  1589.           think this is such a book. You can certainly check it out at your
  1590.           local bookstore and see what you think. Skim through it and see
  1591.           if you agree or disagree. Personally, I'd like to hear from
  1592.           readers who have already paid for the book to see if maybe they
  1593.           disagree with my review. This is the first negative review I've
  1594.           done, and I feel a bit guilty, but I also feel there's a need to
  1595.           warn the readers. Again, if there are readers out there who
  1596.           disagree with my review, I'd like to hear your responses.
  1597.  
  1598.  
  1599.  
  1600.  
  1601.  
  1602.  
  1603.  
  1604.  
  1605.  
  1606.  
  1607.  
  1608.  
  1609.  
  1610.  
  1611.  
  1612.  
  1613.  
  1614.  
  1615.  
  1616.  
  1617.                                         - 29 -
  1618.  
  1619.  
  1620.  
  1621.  
  1622.  
  1623.  
  1624.  
  1625.                                 C++ Beginner's Column
  1626.                                    By Rodney Brown
  1627.  
  1628.              Welcome to C++ For Beginners.  Like Mike, I am also just
  1629.           starting out in C++, but I can see the many advantages, and some
  1630.           disadvantages that C++ has.  For starters, I am going to devote
  1631.           this column to each of the new features that C++ provides.  Once
  1632.           we get these basics down pat, we will then start on a (No, not
  1633.           another one!) 'Hello World' program (You knew it was coming,
  1634.           didn't you?).
  1635.  
  1636.              Some of the items we will be discussing in the next few months
  1637.           are:
  1638.  
  1639.                   Objects/Encapsulation
  1640.                   Polymorphism
  1641.                   Inheritance
  1642.                   And much much more
  1643.  
  1644.  
  1645.              I'm sure you will enjoy learning C++ as much as I am.  Next
  1646.           month, we will begin looking at the differences between C and
  1647.           C++, and begin discussing Objects.
  1648.  
  1649.              Due to time constraints (my hard drive crashed!), I was not
  1650.           able to write a complete article.  If you have any suggestions,
  1651.           obstacles you can't get around or hints/tips, please send them to
  1652.           the e-mail addresses shown below.  Next month, we'll have a full-
  1653.           fledged article for you.  Sorry about that.
  1654.  
  1655.  
  1656.              My E-mail addresses are:
  1657.  
  1658.                   CompuServe: 72163,2165
  1659.                   America Online: RodneyB172
  1660.  
  1661.              Since my last article, I dropped GEnie for America Online
  1662.  
  1663.              You can also contact me at the following Internet addresses:
  1664.  
  1665.                   CompuServe: 72163.2165@compuserve.com
  1666.                   America Online: RodneyB172@aol.com   (Preferred InterNet
  1667.           Address)
  1668.  
  1669.           See ya next month!
  1670.  
  1671.  
  1672.  
  1673.  
  1674.                                         - 30 -
  1675.  
  1676.  
  1677.  
  1678.  
  1679.  
  1680.  
  1681.  
  1682.                            Windows Programmer's Journal BBS
  1683.                                     By Pete Davis
  1684.  
  1685.              I'm going to start doing updates every few months on what's
  1686.           going on with the Windows Programmer's Journal BBS. I thought
  1687.           that, apart from informing you, the reader, about what's going on
  1688.           there, it might provoke some of you to tell us exactly what you'd
  1689.           like to see there.
  1690.  
  1691.              The Windows Programmer's Journal BBS, right now, is still in
  1692.           its infancy. I haven't had the kind of time I'd like to really
  1693.           get it configured the way I want. One of my main objectives is to
  1694.           get the WPJ BBS on FidoNet. Configuration for FidoNet is no small
  1695.           affair and requires a good deal of work. I have some vacation
  1696.           time coming in July and I'm hoping I can get to that then. Once
  1697.           on FidoNet we'll be able to open ourselves up to some of the
  1698.           active conferences out there and, hopefully, maybe even get one
  1699.           started for the magazine eventually.
  1700.  
  1701.              Right now the BBS only has 128 megs. Much of this is taken up
  1702.           with software that isn't really necessary for the BBS. I'll be
  1703.           removing some of that soon as I get a new computer to relocate
  1704.           the software to. In addition, I plan on upgrading the modem to
  1705.           9600 baud. This will make it easier on many of our long-distance
  1706.           callers. Both of these should be in place within the next 4-6
  1707.           weeks. We also have a CD-ROM drive which currently houses the
  1708.           SIMTEL CD-ROM. The CD contains more than 600 megs of public
  1709.           domain and shareware software. We currently have two other CDs
  1710.           that we hope to make available to the BBS as soon as we can get
  1711.           additional drives. The other major purchase for the BBS is a 1+
  1712.           gig hard drive. This purchase will be put off for at least the
  1713.           next 6 months due to a shortage of green paper.
  1714.  
  1715.              The biggest news on the WPJ BBS front is the APIs in the
  1716.           download section. I've been working hard to get APIs and have
  1717.           found some pretty good ones and more are coming soon. Among the
  1718.           ones there now are: OLE Specs for 16-bit and 32-bit Windows, ODBC
  1719.           Specs, Message API Specs (MAPI), and much more. Soon we'll be
  1720.           adding the Telephony API and a few other odd ones that have
  1721.           reared their heads. It seems Microsoft is going API crazy. I'm a
  1722.           bit of an API fan myself, so no complaints from me.
  1723.  
  1724.              As I said, I plan on having some time early in July to get
  1725.           some work on the BBS done. Please leave us comments and
  1726.           suggestions to let us know what you'd like to see.
  1727.  
  1728.  
  1729.  
  1730.  
  1731.                                         - 31 -
  1732.  
  1733.  
  1734.  
  1735.  
  1736.  
  1737.  
  1738.  
  1739.                              The Windows Messaging System
  1740.                                    By Mike Wallace
  1741.  
  1742.                   An integral part of learning how  to program in Windows is
  1743.           understanding the Windows messaging system.  Unfortunately, it is
  1744.           one of  the most  poorly documented areas  of Windows,  deserving
  1745.           much more  attention  than  it gets.  Writing  a  robust  Windows
  1746.           program  demands a  good understanding  of how  your program  and
  1747.           Windows  communicate, and this is done via the messaging system -
  1748.           Windows sends messages to your program and your program responds,
  1749.           and vice-versa.  This is all done via the message queue.
  1750.  
  1751.                   There  are two types  of message queues: a) system harware
  1752.           event queue; and b) application message queue.  The former is for
  1753.           the hardware (e.g., keyboard,  mouse) and timers.  The  latter is
  1754.           for the applications.  There is only one  system queue, but there
  1755.           is an application queue for each running program.  So,  when your
  1756.           program is running and it generates a message from Windows (e.g.,
  1757.           the  user  changed  the  active  window,  generating  a  WM_PAINT
  1758.           message),  Windows will post that  message on the  queue for your
  1759.           application, and on no other queue.
  1760.  
  1761.                   Every message is  serviced by  a function declared in  one
  1762.           of the following two formats:
  1763.  
  1764.           LONG FAR PASCAL Function(HWND hWnd, unsigned msg, WORD WPARAM,
  1765.           LONG LPARAM);
  1766.  
  1767.           BOOL FAR PASCAL Function(HWND hWnd, unsigned msg, WORD WPARAM,
  1768.           LONG LPARAM);
  1769.  
  1770.           The first is for registered dialog and/or window classes, and the
  1771.           second  is for internal class  dialogs.  The  parameters for both
  1772.           are  the  same: hWnd  provides a  handle  to the  window (telling
  1773.           Windows  where the internal info  for that window  is in memory),
  1774.           msg is  the  message, and  WPARAM and  LPARAM contain  additional
  1775.           information about the message (e.g., parameters).  For example, a
  1776.           common  message  Windows  sends  is  WM_COMMAND.    This  can  be
  1777.           g e n e r a t e d       b y       t h e       u s e r       c l i
  1778.           cking  on a  control (e.g., a  button) in  the window.   For your
  1779.           program  to know which control was selected, it needs the numeric
  1780.           identifier  (every  control  in  a  window  must  have  a  unique
  1781.           identifier).  The WPARAM parameter contains this information, and
  1782.           LPARAM  is similar (as an aside,  if you're wondering how to pass
  1783.           other  data to and  from the  window's function  (avoiding global
  1784.           variables),  an  excellent  way  is  to  use  the  "SetProp"  and
  1785.           "GetProp" functions).
  1786.  
  1787.  
  1788.                                         - 32 -
  1789.  
  1790.  
  1791.  
  1792.  
  1793.  
  1794.  
  1795.  
  1796.                   This is  the work of the  messaging system:  it sends your
  1797.           program messages  generated by Windows in response to the actions
  1798.           of the user running your program.  Make sense?  This leads to the
  1799.           "big switch"  functions, so  called because   functions receiving
  1800.           these  messages are  typically  set up  with  the first  line  as
  1801.           "switch  (message) {", followed by a "case" statement (with code)
  1802.           for each message your  program wants to act on.   These functions
  1803.           can be several pages long.
  1804.  
  1805.                   After your  program has  received a  message and  acted on
  1806.           it,  control should  be  returned to  Windows.   This  can  cause
  1807.           problems when you're trying  to learn how to program  in Windows.
  1808.           Most programmers are  used to  sequential code -  the program  is
  1809.           executed  one line at a time.   Under Windows, your program waits
  1810.           to get  called by the messaging  system.  For example,  let's say
  1811.           the user has  just pushed a  button in a  window created by  your
  1812.           application. This generates a  WM_COMMAND message.  Windows knows
  1813.           that  the window belongs to  your application, so  the message is
  1814.           put in the message queue for your application (remember? each app
  1815.           has its  own message queue).   This "wakes up" your  program, and
  1816.           control  is passed to the  function that handles  the window that
  1817.           the user  is in.    When Windows  gets to  the  line inside  your
  1818.           "switch (message) {" block that reads "case WM_COMMAND:", it will
  1819.           usually  find a line that reads "switch (WPARAM) {", which starts
  1820.           a new "big switch"  block, which will have a "case" statement for
  1821.           each  control  in  your window  (it  can  handle  other types  of
  1822.           messages as well, such  as menu items and accelerator  keys). The
  1823.           "case"  statements will get read until Windows finds the one with
  1824.           the  identifier for the button  that was pressed.   Then, at long
  1825.           last, Windows will execute the code for the button pressed by the
  1826.           user.  It's about time, isn't it?  These things are never simple.
  1827.           Sure, I could  rant and rave about  how bizarre this whole  thing
  1828.           is, but  you could probably guess exactly what I would say, so it
  1829.           would all  be kind of  pointless.  If  you want to  write a good,
  1830.           robust Windows  application, you  need to  understand how  all of
  1831.           this  works,  and  it's  not always  intuitive  what's  going on.
  1832.           There's  a lot of information  a Windows programmer  must keep in
  1833.           mind.   If you  don't understand (at  a minimum)  how Windows and
  1834.           your program are communicating, you're in trouble.
  1835.  
  1836.                   If you want  a more detailed  explanation of the messaging
  1837.           system, there are two good articles that may help clear it up:
  1838.  
  1839.           - C User's Journal  (May 1993) : "The Windows  Messaging System",
  1840.           by Mike Klein; and
  1841.  
  1842.           - Dr. Dobbs Journal  (Feb. 1993) : "Inside the  Windows Messaging
  1843.           System", by Matt Pietrik.
  1844.  
  1845.                                         - 33 -
  1846.  
  1847.  
  1848.  
  1849.  
  1850.  
  1851.  
  1852.  
  1853.                     A Review of a Windows-hosted Programming Aid:
  1854.                              Wilson WindowWare's WinEdit
  1855.                                     By Jeff Perkel
  1856.  
  1857.           Let me introduce myself.  My  name is "Jeff", and I'm a shareware
  1858.           junkie.    For those  of  you who  don't  know, "shareware"  is a
  1859.           marketing concept in   which you  are allowed to  try a piece  of
  1860.           software free,  usually for  30  days,  after which time  you are
  1861.           supposed either to register  the program, or delete it  from your
  1862.           hard disk.  It's really sort of  an honor system  thing.  In most
  1863.           cases, even if you don't register, the only thing that happens is
  1864.           that you continue to get  an annoying "Unregistered" message upon
  1865.           startup.
  1866.  
  1867.           Because I  am a shareware junkie,  I'm always on the  lookout for
  1868.           new  and useful shareware.  You'd be  amazed at some of the truly
  1869.           wonderful utilities  available out in  netland for a  fraction of
  1870.           what their
  1871.           commercial counterparts  cost. Why, I've got two  text editors, a
  1872.           checkbook balancing program, a few games, and a few miscellaneous
  1873.           utilities - all shareware.   So, after talking with  Mike Wallace
  1874.           via  e-mail, I've  taken  it upon  myself  to try  and alert  the
  1875.           readers of the WPJ  to new shareware programming utilities.   You
  1876.           may  recall  that  last  month  (issue  5),  a    product  called
  1877.           WinDisassembler was reviwed.   This  column will be  similar   to
  1878.           that. And now, without further ado . . . 
  1879.  
  1880.                           -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  1881.  
  1882.           One of the small pet  peeves I have is writing a  Windows program
  1883.           in  DOS.  This is because, until recently,  I had to code in DOS,
  1884.           compile, and then   run Windows to see that I have made an error,
  1885.           and  then return to  DOS.  I   know I  could have done  this in a
  1886.           Windows DOS session, but  it's much   easier, I thought, just  to
  1887.           compile in DOS.  Not to mention faster.
  1888.  
  1889.           I  currently am using the  Microsoft C/C++ 7.0  compiler with the
  1890.           Windows  3.1   SDK.    This  package  comes  with  an  Integrated
  1891.           Development Environment  (  IDE)  called  the  Programmer's  Work
  1892.           Bench.   This IDE runs  from DOS, looks  like DOS's EDIT.COM, and
  1893.           is, I thought, difficult to use.  I wanted to be able to write my
  1894.           programs in  Windows, in order to  have access to my  on-line SDK
  1895.           help, and, later, to the Developer Network CD.
  1896.  
  1897.           Not  having a  lot of  money to  spend on  this,  I looked  for a
  1898.           shareware  utility that would do the job.   I found one in Wilson
  1899.           WindowWare's WinEdit (reviewed in PC/Computing, April, 1993, page
  1900.           129).   This is a very useful programmer's aid.  The key features
  1901.  
  1902.                                         - 35 -
  1903.  
  1904.  
  1905.  
  1906.  
  1907.  
  1908.  
  1909.  
  1910.           are:
  1911.  
  1912.                   -  Context-sensitive  help.     You  double  click  on   a
  1913.           function,   such  as  CreateWindow(),  and  WinEdit  will  search
  1914.           through the Win3.1 SDK on-line help reference to find that topic.
  1915.           Not  even Microsoft's  Visual  C++ Visual  Workbench offers  that
  1916.           feature.
  1917.  
  1918.                   - Multiple  open files.   Limited  only by your  available
  1919.           memory.
  1920.  
  1921.                   -  Ability to  launch a  program  from  WinEdit.   You can
  1922.           actually  launch  any  program from  WinEdit,  but  the Menu  Bar
  1923.           contains  a Project sub-menu,  containing Compile,  Make, Remake,
  1924.           Debug,  and Execute  functions.   You  can configure  the command
  1925.           lines however  you wish,  and even save  multiple configurations.
  1926.           For  example, you  might have  a "windows"  configuration, and  a
  1927.           "dos" configuration, in order  to compile using different command
  1928.           line switches.
  1929.  
  1930.                   Unfortunately, I  was  never able  to successfully  launch
  1931.           CodeView   for  Windows  from within  WinEdit  - out  of  memory.
  1932.           However, I've  also  only got  4MB  of RAM  (for  that matter,  I
  1933.           couldn't launch CVW from  the PWB, either!)  I  suspect, however,
  1934.           that on a  better programming  platform (i.e., 8MB  RAM or  more)
  1935.           that this would not be a problem.
  1936.  
  1937.                   -  Compiler   capture.    The  program  captures  compiler
  1938.           output,  and moves you to the line with the first error.  You can
  1939.           then skip  to   the next  error, or  to the  previous error.   In
  1940.           addition, you can view the compiler output itself.
  1941.  
  1942.                   - Macro language in the Professional edition.
  1943.  
  1944.                   - On-line help.  Very comprehensive.
  1945.  
  1946.                   - Toolbar.  This  is not user-configurable, but just about
  1947.           any feature that you could ever need is already in there.
  1948.  
  1949.                   - User created extension DLLs.   This allows you to modify
  1950.           WinEdit  to suit  your  needs.   The  on-line help  explains  the
  1951.           implementation of these DLLs, as well as the WinEdit API.
  1952.  
  1953.           I think that  WinEdit offers us about all that  one could ask for
  1954.           in a programmer's text editor.  It's compiler capture feature and
  1955.           context  sensitive  help  features  make  it  a  program  that is
  1956.           certainly worth your while  to examine - especially if  you, like
  1957.           me, were laboring in the pit of DOS unnecessarilly.
  1958.  
  1959.                                         - 36 -
  1960.  
  1961.  
  1962.  
  1963.  
  1964.  
  1965.  
  1966.  
  1967.                             -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  1968.  
  1969.           WinEdit   comes  in   three  versions:     Lite,   Standard,  and
  1970.           Professional, all  in the same ZIPped file.
  1971.  
  1972.           The registration  fees  are $30,  $60,  and $90,  respectively.  
  1973.           However, only the standard and professional versions can compile.
  1974.           The professional  version is simply  the standard version  plus a
  1975.           macro language. 
  1976.  
  1977.           Registration  nets you a disk, a dialog editor, a printed manual,
  1978.           and shipping in the US and Canada.
  1979.  
  1980.           WinEdit  is available  from  PCCONTACT on  Compuserve.   Type  GO
  1981.           PCCONTACT.     WinEdit  is  in  library   3  (utilities/misc)  as
  1982.           WINEDT.ZIP.  It  is also  available via anonymous  ftp on  SIMTEL
  1983.           20 and its mirror sites as pd1:< windows3>WE-20N.ZIP.
  1984.  
  1985.           [The author can be contacted at "perkel_j@a1.mscf.upenn.edu" on
  1986.           the Internet, and on CompuServe at 71404,123.]
  1987.  
  1988.  
  1989.  
  1990.  
  1991.  
  1992.  
  1993.  
  1994.  
  1995.  
  1996.  
  1997.  
  1998.  
  1999.  
  2000.  
  2001.  
  2002.  
  2003.  
  2004.  
  2005.  
  2006.  
  2007.  
  2008.  
  2009.  
  2010.  
  2011.  
  2012.  
  2013.  
  2014.  
  2015.  
  2016.                                         - 37 -
  2017.  
  2018.  
  2019.  
  2020.  
  2021.  
  2022.  
  2023.  
  2024.           Date:  02-Jun-93 16:36 EDT
  2025.           From:  Mike Strock   >INTERNET:MikeS@asymetrix.com
  2026.           Subj:  FW: White House Announcement About E-Mail (fwd)
  2027.  
  2028.            ----------
  2029.           From: Brian Granowitz
  2030.           To: Cool (The Suave Group)
  2031.           Subject: FW: White House Announcement About E-Mail (fwd)
  2032.           Date: Wednesday, June 02, 1993 12:25PM
  2033.  
  2034.  
  2035.                                    THE WHITE HOUSE
  2036.  
  2037.                         Office of Presidential Correspondence
  2038.  
  2039.           ____________________________________________________________ __
  2040.           For Immediate Release                             June 1, 1993
  2041.  
  2042.  
  2043.                      LETTER FROM THE PRESIDENT AND VICE PRESIDENT
  2044.                 IN ANNOUNCEMENT OF WHITE HOUSE ELECTRONIC MAIL ACCESS
  2045.  
  2046.  
  2047.  
  2048.  
  2049.                   Dear Friends:
  2050.  
  2051.                   Part of  our commitment  to change  is to  keep the  White
  2052.           House in step with today's changing technology.  As we move ahead
  2053.           into the twenty-first century, we must have a government that can
  2054.           show  the way  and lead  by example.   Today,  we are  pleased to
  2055.           announce that for the first time in history, the White House will
  2056.           be  connected to you via  electronic mail.   Electronic mail will
  2057.           bring  the Presidency and this  Administration closer and make it
  2058.           more accessible to the people.
  2059.  
  2060.                   The White House will be connected  to the Internet as well
  2061.           as  several  on-line  commercial  vendors, thus  making  us  more
  2062.           accessible and more in touch with people across this country.  We
  2063.           will  not  be alone  in this  venture.  Congress is  also getting
  2064.           involved, and  an exciting announcement regarding electronic mail
  2065.           is expected to come from the House of Representatives tomorrow.
  2066.  
  2067.                   Various government  agencies also will  be taking part  in
  2068.           the  near future.  Americans  Communicating  Electronically is  a
  2069.           project  developed by  several government agencies  to coordinate
  2070.           and improve  access to  the nation's educational  and information
  2071.           assets  and resources.   This  will be  done through  interactive
  2072.  
  2073.                                         - 38 -
  2074.  
  2075.  
  2076.  
  2077.  
  2078.  
  2079.  
  2080.  
  2081.           communications such as electronic mail, and brought to people who
  2082.           do not have ready access to a  computer.
  2083.  
  2084.                   However, we  must be realistic  about the limitations  and
  2085.           expectations of  the White House  electronic mail  system.   This
  2086.           experiment  is the first-ever e-mail project done on such a large
  2087.           scale.   As  we work  to reinvent  government and  streamline our
  2088.           processes, the e-mail project can help  to put us on the  leading
  2089.           edge of progress.
  2090.  
  2091.                   Initially, your  e-mail message will  be read and  receipt
  2092.           immediately acknowledged.  A  careful count will be taken  on the
  2093.           number received as well as the subject of each message.  However,
  2094.           the White House  is not  yet capable of  sending back a  tailored
  2095.           response via electronic mail.  We  are hoping this will happen by
  2096.           the end of the year.
  2097.  
  2098.                   A   number   of   response-based   programs  which   allow
  2099.           technology to help  us read your  message more effectively,  and,
  2100.           eventually respond to you electronically in a timely fashion will
  2101.           be tried out as well.  These programs will change periodically as
  2102.           we  experiment with the best  way to handle  electronic mail from
  2103.           the public.    Since this  has  never been  tried  before, it  is
  2104.           important  to allow for some  flexibility in the  system in these
  2105.           first stages.  We welcome your suggestions.
  2106.  
  2107.                   This is  an historic moment in the White House and we look
  2108.           forward to  your participation and enthusiasm  for this milestone
  2109.           event.  We eagerly  anticipate the day when electronic  mail from
  2110.           the  public is  an integral  and normal  part of the  White House
  2111.           communications system.
  2112.  
  2113.  
  2114.  
  2115.                           President Clinton      Vice President Gore
  2116.  
  2117.                    PRESIDENT@WHITEHOUSE.GOV                                
  2118.           VICE.PRESIDENT@WHITEHOUSE.GOV
  2119.  
  2120.  
  2121.  
  2122.  
  2123.  
  2124.  
  2125.  
  2126.  
  2127.  
  2128.  
  2129.  
  2130.                                         - 39 -
  2131.  
  2132.  
  2133.  
  2134.  
  2135.  
  2136.  
  2137.  
  2138.                                  Text Manager Review
  2139.                                    By Mike Wallace
  2140.  
  2141.                   Windows programmers get touchy when it comes to editors. 
  2142.           All of the best editors, it seems, are DOS-based, and it's a pain
  2143.           to write the code under DOS, compile, and then start up Windows
  2144.           to test your app.  A lot of time could be saved if there was a
  2145.           good Windows-based editor, but there don't seem to be very many
  2146.           to choose from.  One choice is Text Manager.  I've been a beta-
  2147.           tester for it, and it's a good program.  Version 1.0 has been
  2148.           around for a while, but Digital Software is about ready to
  2149.           release version 2.0.
  2150.  
  2151.                   Text Manager can be used to edit any text file, but has
  2152.           added functionality for C files, INI files and batch files.  If
  2153.           you select "Open..." from the "File" menu bar item, you can have
  2154.           it only list files with a filetype of ".C", ".INI", ".BAT",
  2155.           ".TXT" or ".*" to get all files.  This comes in handy when you're
  2156.           writing C code.  You can also open multiple files, and if you
  2157.           minimize the file, the icon for it is determined by the file
  2158.           type, so a ".C" file is readily distinguishable from a ".INI"
  2159.           file.  Other features include:
  2160.  
  2161.           - Toolbar and status bar
  2162.  
  2163.           - Pressing on a menu bar item or button will cause the status bar
  2164.           to tell you what it does
  2165.  
  2166.           - You can set the printer font to be different than the screen
  2167.           font
  2168.  
  2169.           - Closing Text Manager when it is either maximized or minimized
  2170.           will cause it to open the same way the next time you run it (the
  2171.           author tells me this also is true for any text file you open, but
  2172.           I wasn't able to get it to work).
  2173.  
  2174.           - Text Manager will remember the files you worked with the last
  2175.           time you were running Text Manager
  2176.  
  2177.           -  A full online help file (the author is working on this part
  2178.           now so I haven't seen it)
  2179.  
  2180.           - Print preview
  2181.  
  2182.           - Standard editing capabilities (e.g., cut, copy, paste, find,
  2183.           replace)
  2184.  
  2185.           - Support from Digital Software - the author (Kerim Erden) checks
  2186.  
  2187.                                         - 40 -
  2188.  
  2189.  
  2190.  
  2191.  
  2192.  
  2193.  
  2194.  
  2195.           his CompuServe mail several times a day and always answers all of
  2196.           his mail.  All of my contact with Mr. Erden has been by e-mail
  2197.           and he has always responsed very quickly to my questions.
  2198.  
  2199.            - Registration will net you an install disk (the installation
  2200.           program is graphical)  with some extra utilities on it.
  2201.  
  2202.                   If you're looking for a straightforward, easy-to-use
  2203.           Windows-based text editor, try out Text Manager.  It could be
  2204.           well worth your time to try it out.  It's available as shareware
  2205.           and only costs $10.  Text Manager 2.0 will soon be available on
  2206.           the IBMSYS, WINSHARE and NORUTL forums on CompuServe.  Questions
  2207.           can be directed to Kerim Erden of Digital Software at CompuServe
  2208.           ID 72133,257.
  2209.  
  2210.  
  2211.  
  2212.  
  2213.  
  2214.  
  2215.  
  2216.  
  2217.  
  2218.  
  2219.  
  2220.  
  2221.  
  2222.  
  2223.  
  2224.  
  2225.  
  2226.  
  2227.  
  2228.  
  2229.  
  2230.  
  2231.  
  2232.  
  2233.  
  2234.  
  2235.  
  2236.  
  2237.  
  2238.  
  2239.  
  2240.  
  2241.  
  2242.  
  2243.  
  2244.                                         - 41 -
  2245.  
  2246.  
  2247.  
  2248.  
  2249.  
  2250.  
  2251.                               Getting in touch with us:
  2252.  
  2253.           Internet and Bitnet:
  2254.  
  2255.           HJ647C at GWUVM.GWU.EDU -or- HJ647C at GWUVM.BITNET (Pete)
  2256.  
  2257.           GEnie: P.DAVIS5 (Pete)
  2258.  
  2259.           CompuServe: 71141,2071 (Mike)
  2260.  
  2261.           WPJ BBS (703) 503-3021 (Mike and Pete)
  2262.  
  2263.           You can also send paper mail to:
  2264.  
  2265.           Windows Programmer's Journal
  2266.           9436 Mirror Pond Drive
  2267.           Fairfax, VA   22032
  2268.                 U.S.A.
  2269.  
  2270.                   In future issues  we will be  posting e-mail  addresses of
  2271.           contributors  and columnists  who  don't mind  you knowing  their
  2272.           addresses. We will also contact any  writers from previous issues
  2273.           and see if they want their mail addresses made available for  you
  2274.           to respond to them. For  now, send your comments to us  and we'll
  2275.           forward them.
  2276.  
  2277.  
  2278.  
  2279.  
  2280.  
  2281.  
  2282.  
  2283.  
  2284.  
  2285.  
  2286.  
  2287.  
  2288.  
  2289.  
  2290.  
  2291.  
  2292.  
  2293.  
  2294.  
  2295.  
  2296.  
  2297.  
  2298.  
  2299.  
  2300.                                         - 42 -
  2301.  
  2302.  
  2303.  
  2304.  
  2305.  
  2306.  
  2307.  
  2308.                                     The Last Page
  2309.                                    by Mike Wallace
  2310.  
  2311.                   Got this in  the mail a few days  ago.  Hope you like  it.
  2312.           If you read  this column last month (it was  about OS/2) and want
  2313.           to read  a different point of view from reader Jeff Miller, go to
  2314.           the  "Letters" section  at the  beginning of  the issue.   Jeff's
  2315.           letter is  included (in its  entirety), followed by  my response.
  2316.           This is  the kind of debate I was hoping this column would spark.
  2317.           If anyone else has some criticism about  this column or any other
  2318.           part of the magazine,  please write.   We want WPJ  to be one  of
  2319.           your sources of help when you're programming, and if we can  make
  2320.           WPJ better, then we want to know how. Talk to you next month.
  2321.  
  2322.  
  2323.           Date:  24-May-93 11:31 EDT
  2324.           From:  Mike Strock   >INTERNET:MikeS@asymetrix.com
  2325.           Subj:  NEWS BULLETIN - Men and women are NOT alike.
  2326.  
  2327.           Sure, you thought you already knew  that.  But now we have proof!
  2328.           After countless  hours of  surveys and  studies on  the following
  2329.           topics, these facts have emerged.
  2330.  
  2331.           Relationships:
  2332.  
  2333.           Women  have deep,  meaningful, mutually  nurturing relationships.
  2334.           Men have  "that time when me  and Suzie was  doing it on  a semi-
  2335.           regular basis".
  2336.  
  2337.           When a relationship ends, a woman will cry and pour her heart out
  2338.           to her girfriends, and she will write a poem titled  "All Men Are
  2339.           Idiots".    Then    she    will    get    on    with    her    li
  2340.           fe,  usually by meeting another man and doing an emotional belly-
  2341.           flop.
  2342.  
  2343.           A man will call six months after the break-up, at  3:00 a.m. on a
  2344.           Saturday  night, and  say, "I  just wanted  to let  you know  you
  2345.           ruined my life,  and I'll never forgive you, and  I hate you, and
  2346.           you're a  total floozy.  But I want you  to know there's always a
  2347.           chance  for us".  This is  known as the "I Hate  You/ I Love You"
  2348.           drunken phone call, that 99% of all men have made at least once.
  2349.  
  2350.           Women prefer 30-40 minutes of foreplay.  Men prefer 30-40 seconds
  2351.           of foreplay.   Men consider driving back to her  place as part of
  2352.           the foreplay.  Women  consider getting  married  as part  of  the
  2353.           foreplay.
  2354.  
  2355.           Maturity:
  2356.  
  2357.                                         - 43 -
  2358.  
  2359.  
  2360.  
  2361.  
  2362.  
  2363.  
  2364.  
  2365.           Women  mature before men do. 17-year-old females can function  as
  2366.           adults, but  don't. 17-year-old  males can't function  as adults,
  2367.           and don't care.  This is why high school romances rarely work.
  2368.  
  2369.           Handwriting:
  2370.  
  2371.           Women use scented,  coloured stationery and they dot their "i's",
  2372.           with circles and hearts.   Women use ridiculously large  loops in
  2373.           their "p's" and "g's".   It is a royal pain to read a note from a
  2374.           woman.  Even when she's dumping you, she'll put a  smiley face at
  2375.           the end of the note. Men  do not decorate their penmanship.  They
  2376.           chicken-scratch.
  2377.  
  2378.           Bathrooms:
  2379.  
  2380.           A  man has six items  in his bathroom:  a toothbrush, toothpaste,
  2381.           shaving cream,  razor, a bar of  Dial soap, and a  towel from the
  2382.           Holiday Inn. The  average number  of items in  a typical  woman's
  2383.           bathroom  is 437.  A  man would not  be able to  identify most of
  2384.           these items.  A woman uses each of them every morning.
  2385.  
  2386.           Groceries:
  2387.  
  2388.           A man waits till the only item left in his fridge are half a lime
  2389.           and  a  Blue.  Then he  goes  to  the  grocery  store,  and  buys
  2390.           everything  that looks  good.   By  the time  a  man reaches  the
  2391.           checkout counter, his cart is packed tighter  than the Clampett's
  2392.           car on Beverly  Hillbillies.  Of  course, this will not  stop him
  2393.           from going to the 10-items-or-less lane.  When a woman does this,
  2394.           it is called shopping.
  2395.  
  2396.           Going out:
  2397.  
  2398.           When a man says he is ready to go out, it means he is ready to go
  2399.           out. When a woman says she is ready to  go out, it means she WILL
  2400.           be ready  to go out, as  soon as she finds  her earring, finishes
  2401.           putting on her makeup...
  2402.  
  2403.           Cats:
  2404.  
  2405.           Women love  cats.  Men say  they love cats, but  when women are't
  2406.           looking, men kick cats.
  2407.  
  2408.           Dressing up:
  2409.  
  2410.           A woman will dress up to go shopping, water the plants, empty the
  2411.           garbage, answer the phone, read a book, get the mail.  A man will
  2412.           dress up for: weddings, funerals.
  2413.  
  2414.                                         - 44 -
  2415.  
  2416.  
  2417.  
  2418.  
  2419.  
  2420.  
  2421.  
  2422.           David Letterman:
  2423.  
  2424.           Men think  David Letterman is the funniest man on the face of the
  2425.           earth. Women think he is a mean, semi-dorky guy who  always has a
  2426.           bad haircut.
  2427.  
  2428.           Laundry:
  2429.  
  2430.           Women  do laundry every  couple of days.   A man  will wear every
  2431.           article of clothing  he owns, including  his surgical pants  that
  2432.           were hip  about eight years  ago, before he will  do his laundry.
  2433.           When  he  is  finally  out  of  clothes,  he  will  wear  a dirty
  2434.           sweatshirt inside out,  rent a  U-Haul and take  his mountain  of
  2435.           clothes to the laundromat.   Men always expect to  meet beautiful
  2436.           women at the laundromat.  This is a myth.
  2437.  
  2438.           Weddings:
  2439.  
  2440.           When reminiscing about weddings, women talk about "the ceremony".
  2441.           Men talk about "the bachelor party".
  2442.  
  2443.           Socks:
  2444.  
  2445.           Men  wear sensible socks.   They wear  standard white sweatsocks.
  2446.           Women wear strange  socks.   They are cut  way below the  ankles,
  2447.           have pictures of clouds on them, and have a big fuzzy ball on the
  2448.           back.
  2449.  
  2450.           Slippers:
  2451.  
  2452.           Men wear leather slippers that have been brought to them by their
  2453.           faithful  dog.  Women wear  huge fuzzy orange  things with faces,
  2454.           that look like puppies.
  2455.  
  2456.           Nicknames:
  2457.  
  2458.           If Gloria, Suzanne, Deborah and Michelle get together for  lunch,
  2459.           they will  call each other Gloria, Suzanne, Deborah and Michelle.
  2460.           But if  Mike, Dave, Rob and Jack go out  for a brewsky, they will
  2461.           affectionately  refer  to each  other  as  Bullet-Head, Godzilla,
  2462.           Peanut Brain and Useless.
  2463.  
  2464.  
  2465.  
  2466.  
  2467.  
  2468.  
  2469.  
  2470.  
  2471.                                         - 45 -
  2472.  
  2473.  
  2474.