`
`
`i
`
`y A
`
`.w A More Accurate Timing Tool
`
`1
`
`
`
`
`
`
`
`
`
`lo order!
`ore abollithe
`-,Checkel 4‘0
`n/bc4.hlml
`
`
`
`
`
`Volume 7, Number 8
`$4.95 U.S. Canada $5.95
`
`/ n
`gl
`
`5
`7447077877
`A Miller Freeman Publication
`
`' werwamewu “I
`
`s-:
`
`-.
`
`'
`
`--
`
`':- '-'4'
`
`n -"'
`
`..'
`
`--..--..
`
`-. ..
`
`1
`
`KINGSTON 1012
`
`
`
`
`
`
`
`
`
`
`
`
`'
`
`
`
`
`
`,
`
`
`
`
`
`
`
`
`
`7
`
`gig—
`
`
`
`
`
`
`
`
`A”
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`1‘
`
`
`
`
`i
`2
`\
`.....................
`
`
`
`
`~
`I.
`V
`sCheckeriU
`JndsChecierisug++ Of the month
`i Visual C++ .
`Emmi. The Missing
`iing source n0?
`is trampweii Warning Message
`V“l
`‘y bugs. Byh
`in release hlg‘reCh Tips
`L Cambabaxes in Toolbars
`M40 Understanding NT
`OLE interfaces
`imam Debugging Services
`eyowowanook‘s in Brief
`New. The MindShare Series,
`; 05 YOU debUg
`s
`
`. Delphi and more
`
`1
`
`KINGSTON 1012
`
`
`
`
`
`Windows
`D DEVELOPER'S JOURNAL
`The Magazine for Windows Programmers
`
`‘Ir
`
`v—-~1r
`v“‘
`
`
`‘v—m“~w‘'
`MW4—v—nv‘
`
`ear-“4“‘7
`
`‘,_.
`
`‘1
`
`
`
`
`
`A Palette Spy Utility
`Using an identitypalette is essential for fast graphics, but how can you be sure you got
`it right? This tool uses some undocumented techniques to give you the information you
`need.
`Chris Branch
`
`AMoreAccurateTimingTool14
`The only way to squeeze those extra cycles out of the CPU is to make changes and
`measure the results. Abrash’s "Zen timer” has often been used for that purpose, but
`how accurate is it? Here’s a look at some problems this kind of timer has and how to
`improve it.
`Mike Dawdy
`
`. . . . . .27
`. . .
`. .
`.
`.
`. .
`. . .
`Compiler Benchmark: C++ Iniining .. .
`How much overhead do you pay for using C++ instead ofjust C? We start looking for
`some answers to that question by benchmarking how efficiently five 32-bit Windows
`compilers can handle a simple inline function.
`Ron Burk
`
` .
`
`.
`buggers are available for debugging services? The
`answers are all here, along With the undocumented method for attaching a process With
`the Visual C++ debugger.
`Paula Tomlinson
`
`August 1996
`
`
`
`
`
`
`
`
`2
`
`
`
`
`
`August 1996
`Volume 7, Number 8
`
`CD-
`
`§"
`
`BooksinBrief 61
`Paula Tomlinson reviews the System Architecture series of books by MindShare. Also,
`The Revolutionary Guide to MFC 4 Programming with Visual C++, by Mike Blaszczak;
`Teach Yourself Delphi 2 in 21 Days, by Dan Osier, Steve Grobman, and Steve Batson
`(reviewed by George Tylutki).
`Ron Burk
`
`Bug++oftheMonth..................................67
`It you use the delete operator, the compiler has to generate code to call the destructor
`for that object. But what if the compiler doesn't yet know whether or not you defined a
`destructor? Isn’t it a bug it it doesn’t warn you that it may be generating incorrect code?
`Yes and no, as this month’s non—bug shows.
`Mark Nelson
`
`
` Annotationfitfi 28 —méetDialogBaseunits . . .
`. .60
`Annotation #129 — GetShortPathName . . . .
`
`Annotation #130 — CCheckListBox::Create
`Annotation#131——TBBUTTON................................68
`Annotation #132—EM_POSFROMCHAFI 69
`
`. .62
`
` Prom thewEditor
`
`. . .
`.
`Advertiser Index . .
`CallforPapers..............................................51
`NewProducts
`70
`Readers’Forum.............................................74
`
`Developer’s Marketplace .
`
`
`'Next Month
`
`Drop in on our Web site! You’ll find us at:
`
`http://www.wdi.com
`
`
`You‘ll find information and excerpts from the Current issue, along with links to WDJ code,
`including our SDK Annotations.
`
`Check it out — and let us know what you think.
`
`Online Source Code
`
`
`
`
`EXCept where copyright is explicitly asserted, all code published in Windows'Deyeloper’s
`
`Jaurnal may be freely used and distributed in personal and commercral applications.
`
`You can obtain source code for Windows Developer’s Journal, including unpublished code and the
`
`
`latest compilation of our SDK Annotations, from:
`_
`CompuServe — GO SDFORUM, Library 7.
`
`
`GEnie — in the Windows Floundtable at page 1335 (Keyword2WIndows).
`FTP site: ttp.mfi.com in pub/windev
`
`
`
`
`8335:
`Phoenix Chapter ACM Library —- (602) 821-1162;
`
`
`The Courts of Chaos — (501) 985-0059;
`EmmaSott Shareware Board —— (607) 533-7072;
`
`
`
`
`CEBBS (The Netherlands), +31-(0)-4930-20361 or +31-(0)—4930-20792.
`.
`Code Disk:
`
`
`
`
`Code disks are available per issue ($5). Contact Miller Freeman, lnc., Customer Relations,
`
`14300-4444881; (913) 838-7500; fax (913) 841-2624; or, via e-mail, wdsub@ mfI.com.
`
`August 1996
`
`‘v
`
`7...,w,
`v~a
`
`wr-
`
`
`
`"““V‘”‘v‘m'“‘—v“"V‘'7‘”“‘w
`7/
`
`.,v
`
`ar-
`
`‘3—
`
`Windows
`I! DEVELOPERS JOURNAL
`The Magazine for Windows Programmers
`EDITORIAL
`Senior Editor
`Managing Editor
`Contributing Editors
`
`
`
`
`
`
`
`Ran Burk
`Ann Bracker
`Paula Tomlinson
`Victor R. Valknuzn
`
`Lear Zolrnan
`Mark Nelson
`V. Ramar‘hundran
`
`Send reader mail to: wdlottefimfixom.
`PUBLISHER
`
`Peter Hutchinson
`Publishing Director
`Martha Masinmn
`Associate Publisher
`
`ADVERTISING AND MARKETING
`
`
`
`Director of Sales and
`Marketing
`
`
`Acct. Manager, East
`
`Acct. Manager, Midwest
`
`Acct. Manager, West
`
`European
`Advertising
`Representative
`
`FAX:
`Email:
`
`Bill Uhler
`Ed Day
`(913) 838-7547
`
`
`eday@rnfi,cum
`
`
`Christine Wuudley
`
`
`(913) 838-7546
`
`
`cwoodley®mficorn
`
`Julie Thornton
`
`
`(913) 838-7541
`
`
`jthomla®rnficum
`
`
`breakout! marketing
`
`
`Duevelsbeker Weg 4
`24105 Kiel
`Germany
`
`
`+49 431—801740
`
`
`+49 431-801797
`
`
`100.332.1704
`
`
`@compuserve.corn
`Joni Hemly
`
`
`Sales Support Manager
`Cherilyn Olmsted
`Circulation Manager
`
`
`
`PRODUCTION
`
`Graphic Artist
`
`Production Editors
`
`
`
`Twyla Watson Bagaard
`Amy Pattie
`Lori White
`Lari White
`Ad Materials
`
`
`
`
`
`
`
`Wm.
`
`Subscriptions: Annual
`renewable
`subscriptions
`ro
`Windows Dzvrlopzr's Journal are $34.99 US, $45 Canada and
`Mexico, 364 elsewhere. Payments must be made in US dol-
`lars. Make checks payable to Windows Developer's JaurnaL
`Entire contents Copyright © 1996 Miller Freeman, Inc,
`except where otherwise noted, No portion of this publication
`may be reproduced, stored, or transmitted in any form.
`including computer
`retrieval, without wnlten permission
`from the publisher. All Rights Reserved. Quantity reprints of
`selected articles may be ordered. By-lined articles express the
`opinion of the author and are not necessme the opinion of
`the publisher, Printed in the United States ofAmerica.
`Advertising: For rate cards or other information on
`placing advertising in Windows Developer‘s Journal, contact
`the advertising department ar
`(913) 84l-1631. or write
`Window: Developer's Journal, 1601 W. 23rd St., Suite 200,
`Lawrence, KS mmmo USA.
`Customer Service: For SlleCriplioll orders and
`address changes, contact Windows Developer's Journal, PO.
`Box 56565, Boulder. CO 803226565 USA. Telephone 17
`800-365-1425 or (303) 6780439; fax (303) cot-1885; email
`wdsub@mfi,com.
`For informarion about back issues and article reprints,
`call 1300-4444881 or 913-841-1631.
`_______________._.————-—————-
`MILLER FREEMAN, INC.
`
`Chairman/CEO ..
`....Marshall W Freeman
`President/COO ..
`......... Thomas L Kemp
`
`
`Senior Vice President, CFO
`Warren “Andy" Ambrose
`Senior Vice President ..
`...... Dumll Denny
`David Nussbuum
`Senior Vice President .
`
`. Donald A. Puzour
`
`Senior Vice President.
`
`...... Wini D. Rag-us
`Senior Vice President A
`
`Vice President/Software.
`Regina Starr Ridley
`..Andrew A. Mickus
`Vice President/Production ,.
`
`
`......... Jerry Okabe
`Vice President/Circulation ........
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`”L” Miller Freeman
`A United News St Media publication
`
`Windows Developer’s Journal — Page 3
`
`
`
`
`
`
`
`3
`
`
`
`
`
`
`
`
`
`Books in Brief
`
`First impressions of Recent Titles
`
`
`Ron Burk
`
`
`_,.‘;.5. Wu,“ maw.,.......~ .
`
`CARDBUS
`SYSTEM
`ARCHITECTURE
`
`
`
`
`ISA System Architecture, 3rd Ed.
`Tom Shanley and Don Anderson
`517 pages
`MindShare, Inc. and Addison—Wesley, 1995
`$34.95
`ISBN 0-201—40996-8
`
`80486 System Architecture, 3rd Ed.
`Tom ShanIey
`188 pages
`MindShare, Inc. and Addison—Wesley, 1995
`$19.95
`ISBN 0-201—40994—1
`
`PCI System Architecture, 3rd Ed.
`Tom Shanley and Don Anderson
`557 pages
`MindShare, Inc. and Addison-Wesley, 1995
`$34.95
`ISBN 0-201—40993-3
`
`EISA System Architecture, 2nd Ed.
`Tom Shanley and Don Anderson
`207 pages
`MindShare, Inc. and Addison—Wesley, 1995
`$24.95
`ISBN 0-201 ~40995-X
`
`Pentium Processor System Architecture, 2nd Ed.
`Tom Shanley and Don Anderson
`433 pages
`MindShare, Inc. and Addison-Wesley, 1995
`$29.95
`ISBN 0201—40992-5
`
`PCMCIA System Architecture, 2nd Ed.
`Don Anderson
`440 pages
`MindShare, Inc. and Addison-Wesley, 1995
`$29.95
`ISBN 0-201—40991—7
`
`PowerPC System Architecture
`Tom Shanley
`609 pages
`MindShare, Inc. and Addison»Wesley, 1995
`$34.95
`ISBN 0—201—40990-9
`
`Plug and Play System Architecture
`Tom Shanley
`327 pages
`MindShare, Inc. and Addison—Wesley, 1995
`$29.95
`ISBN 0—201—41013v3
`
`CardBus System Architecture
`Don Anderson and Tom Shanely
`407 pages
`MindShare, Inc. and Addison-Wesley, 1996
`$29.95
`ISBN 0-201-40997-6
`
`Protected Mode Software Architecture
`Tom Shanley
`310 pages
`MindShare, Inc. and Addison-Wesley, 1996
`$29.95
`ISBN 0-20140996-8
`
`W G
`
`ot an opinion about these or other programming books? Send them to 70302.2566@compuseroe.com. You can order any of the books
`that appear in Books in Brieffrom Miller Freeman, Inc. by calling (913) 841-1631, faxing (913) 841-2624, or sending email to
`rdorders@rdpub.com. If usingfax or email, send the book title, author, and publisher along with your MasterCard or Visa number, expi—
`ration date, and phone number.
`
`To submit booksfor review, send them to: Ron Burk, 13846 NE 60th Way, #120, Redmond, WA 98052-4542. Please do not send press releases to
`this address.
`
`August 1996
`
`Windows Developer’s Journal — Page 61
`
`ther
`I86?
`tual
`
`ads,
`lays
`Srvc
`tan-
`and
`
`one
`f its
`iver
`eri-
`IICh
`vas,
`
`sys-
`rith
`out
`the
`
`any
`
`i to
`ng,
`(or
`iny
`lys,
`;a’s
`\IT.
`ent
`
`for
`)01.
`me
`of
`
`IZUS
`
`1
`3r 5
`
`ith
`
`I96
`
`4
`
`
`
`,.
`
`Illl
`
`[Editor’s note: this review was provided by Paula Tomlinson.)
`I first discovered the System Architecture series a couple
`years ago at the bookstand that Computer Literacy always
`runs during the Software Development conferences. At that
`time, these books were published directly by MindShare
`and had very generic and nondescript black-and-white
`covers, so I almost overlooked them. I spotted the ISA and
`EISA books first. After leafing through them that night, I
`ran back to the bookstand the following day to buy any
`other books in the series, not dissuaded in the least by the
`prospect of hauling them back home with me. CardBus
`System Architecture is just the latest in this PC Architecture
`Series that currently totals 10 books. Addison-Wesley is
`now publishing these books with MindShare, so the more
`colorful cover art and wider distribution should ensure that
`
`you will be able to find them at any bookstore with a rea—
`sonable stock of computer titles.
`I admit that there are so few good hardware books avail—
`able that I tend to get enthusiastic about even mediocre
`attempts. But this series of books is truly an important part
`of my library. The series is generally based around proces-
`sor architectures and bus architectures (with a few miscella—
`neous topics such as Plug—and-Play). I find that most books
`that call themselves processor architecture books are really
`references for the assembly language instruction set of that
`particular processor. While those books fill a need, they
`don’t give readers an understanding of the overall hard-
`
`ware design and are not adequate references for device dri.
`ver writers. This is especially true of bus architectures,- for
`example, it is extremely difficult to find good technical
`information about the PCI or PCMCIA buses. When I do
`manage to find an occasional hardware reference on the
`bookshelf, I almost hesitate to pick it up for fear of seeing
`the inevitable $89+ price tag. As a welcome relief,
`the
`MindShare series titles range from $19.95 to $34.95. At this
`price, I don’t feel bad spending the money on a book I
`might use only as an occasional reference.
`Ironically,
`though, my office copy of EISA System Architecture current-
`ly holds the title of ”most
`likely to be borrowed by a
`coworker.”
`
`The format of these books is quite different than that of
`the average computer book. Each book is based on a semi-
`nar taught by the author and that heritage is evident in the
`book’s structure —- it flows more like modules than chap-
`ters. Like most hardware books, they get right to the point;
`there are none of the self-indulgent authorial digressions
`that you see in some software development books. But,
`unlike most hardware books, these are actually readable.
`Most hardware references read like encyclopedias —- even
`the publishers don’t expect anyone to actually read the
`
`WINGHAF 2.0
`(for MS Windows)
`
`
`
`INGRAF 7.0
`(for DOS/DOS Extenders)
`
`
`
`WINGRAF & INGRAF are Graphics libraries for Scientific,
`Engineering and Business applications. Each library contains over
`
`
`150 routines. C, FORTRAN, BASIC and PASCAL versions.
`
`FULL SOURCE CODE
`NO ROYALTIES
`
`
`|||l|
`Illllll
`|
`
`illlllll
`|
`
`
`
`
`9’5
`\‘
`
`
`
`
`o‘o’o‘«o o oo \
`
`
`
`Illlll
`NIH |
`Illlllll
`l
`
`l
`
`
`
`fo‘o’o’o\
`
` PRESSURE(psi)
`
`,
`.
`lillll
`llllllll
`I
`llllllll
`|
`:‘o’o’o’o’o"99oe
`
`
`»
`coon A
`
`lillllll
`|
`llllllll
`|
`iocooooo’ou
` pooooefiu
`
`
`0 O O 9)
`
`
`Hill
`1
`llllllll
`|
`llllllll
`l
`
`gay-‘- I
`
`
`
`
`l||||
`Illlllll
`|
`llilllll
`|
`100
`m
`
`(T+dt) /dt
`
`
`
`
`llr‘lllllim—lli—ri-i
`
`
`Sutrasoft
`
`PO. Box 1733
`
`Sugar Land, TX 77787—1733
`
`Tel: (713) 491-2088
`Fax: (713) 240—6883
`
`76163.1164@compuserve.com
` a Request Reader Service #147 o
`Page 62 — Windows Developer's Journal
`
`1
`
`
`
`
`-i.s
`
`.c
`
`CAPACITIVE REACTANCE
`
`/
`m m m m w u- M Am m x:
`1934
`
`Iov
`
`nu
`
`«C'.5;v~MMfi‘M-fl$&mm
`
`SDK Annotation #130
`
`TYPE: MFC
`TOPIC: CCheckListBox::Create
`KEYWORD: CCheckListBox::Create
`
`The documentation mentions that the deter
`parameter could be any of the specified
`listbox styles. However, the deter
`parameter should NOT be
`LBS_MULTICOLUMN or
`
`LBS_USETABSTOPS. Morever, you need to
`specify LBS_OWNERDRAWFIXED and
`
`LBS_HASSTRINGS.You can specify
`LBS_OWNERDRAWVARIABLE instead of
`LBS_OWNERDRAWFIXED, but then you
`need to override CCheckListBox22Drawltem,
`otherwise the debug version will ASSERT.
`
`Submitted by Sudhir Menon.
`
`Get the entire set of annotations from www.wdj.com or
`CompuServe (file sdkann.zip in section 7 "FMD Publications”
`of Iorum SDFOFtUM). Contribute your own annotations via
`email to 70302.2566@compuserve.com (indicate which topic
`
`in which help file you are annotating).
`
`
`
`
`
`
`
`5
`
`
`
`.
`. Wrwj¢vewfiflxfifiwxis
`
`
`entire book. For developers who do not already have a
`strong hardware background, this lack of truly readable
`information makes learning about the hardware a particu-
`larly daunting task. As long as readers bear in mind that
`some of the books are prerequisites for others, then these
`books should be accessible to developers with very little
`previous hardware background. In the front of each book is
`a chart that describes which books build on others. Some of
`them, such as PowerPC System Archicture, stand alone. But,
`for example,
`it’s recommended that you first read 15A
`System Architecture before reading EISA System Architecture.
`Although these books are not the most comprehensive
`references available on each topic, they are consistently
`accurate (several of them are already in their third editions)
`and very accessible to hardware novices. I would recom-
`mend them to anyone doing hardware design or support,
`as well as to any developers who write low-level system
`code (such as device drivers). I find the bus architecture
`books especially useful references.
`Addison—Wesley informs me that books on the Pentium
`Pro processor and the Universal Serial Bus are due out later
`this year. If Torn Shanley and Don Anderson (as well as
`Addison-Wesley) are listening,
`I will cast my vote for
`adding the following books to the future lineup: 1394, SCSI,
`DEC Alpha Processor, and the MIPS R44xx/R10000 proces-
`sor.
`
`wwflamntymx-wrm
`
`~
`seen-av
`spELuNG .
`CHECKER {3
`ENG'.E
`
`> Checks text strings and edit controls
`> includes_100,000-word American and
`British dictionaries
`> Use our built-in dialogs or write your
`
`a;was»
`
`
`) Dutch, Finnish, French, Italian, German, Spanish, and
`Swedish dictionaries available
`) Integrates easily with C/C++, VB, and Delphi apps
`> Royalty Free
`> Portable C source code available
`> 16- and 32-bit SDKs just $169.00 each
`.4
`) Synonyms and antonyms for over
`, THESDB ~.~
`40,000 key words
`<5, THESAURUS
`DATABASE .
`
`) Words classified by parts of speech:
`Adjectives, adverbs, nouns, and verbs
`) Integrates easily with C/C++, VB, and Delphi apps
`) Add your own synonyms to a user thesaurus
`) Royalty Free
`> Portable C source code available
`> 15- and 32-bit SDKs just $399.00 each
`
`FREE DEMO-”Download SSCEZIP or THESDBZIP lrom CompuServe’s
`WlNSDK forum, Public Utilities library, Or call tor your free copy.
`may; lNEONisilour Web page at httttljloxnslnoakwsi or call.
`Sales: 1 -800-340-8803
`W'
`Phone: 613-825-6271
`mte I’ll/‘66
`FAX: 613—825-5521
`Email: wsi@f0x.nstn.ca
`5 0
`F
`T w A
`R
`E
`
`N
`
`August 1996
`
`D Request Reader Servtce #148 0
`
`a Request Reader Service #149 a
`Windows Developer’s Journal —- Page 63
`
`
`ISBN 1-874416-92—3
`
`The Revolutionary Guide to MPC 4
`Programming with Visual C++
`Mike Blaszczak
`
`871 pages
`WROX Press, 1996
`$49.95
`
`This is the second edition of this book, and in the PC pro-
`gramming book market, books rarely improve with time (in
`fact, they usually disappear after the first printing). The
`Windows 3.1 update of Petzold’s book was a disappoint-
`ment, the second edition of Marshall Brain’s Win32 System
`Services is mostly a name change that attempts to attract
`Win95 programmers, and there are other examples. This
`book is an exception because this edition is better than the
`first — much better.
`I reviewed the first edition of this book in December 1995
`
`column, and though it had some redeeming qualities, Ijust
`couldn’t recommend it. The writing was in dire need of edit—
`ing, the choice of topics didn’t always make sense, and its
`900 pages consisted of as much white space as useful infor-
`mation — the sort of general mediocrity you find in most
`programming books at your local bookstore. At Software
`Development ’96, I stopped by the WROX booth and heard
`
`Pmtndexm
`
`Full-Text Indexing and Retrieval
`Development Toolkit!
`
`
`
`powerrulww-«We Portableewww9
`Unlimited documentsizeand quantity“;
`“DOS, ModawsfllJlLflSLsuff
`Full control oldocument parsing
`05/2, Macintosh, ,NeXLZUnixm,
`Keyword, Boolean, Wildcard
`C/C+ + VB Delphi and otheis
`Phrase, Platinum;
`’
`' e..._'......r...;
`Paraphrasa‘Delimiled Search
`Unicode, Asian, and European
`Multilevel nested expressions
`character supponr
`f
`lawWarn—val
`
`3.5;; ixhthfiAssn
`Frill irii'illtioser support
`'-
`.
`,rWOIREWhh‘IANIWANZ‘otid Internet
`f.SimuInnecesindelnaendaeltievaml1..
`iEfficient index base tuning
`
`Fast
`raj
`Unequaled indexing speed
`Fast compleifiaiclies
`FindJMXACl location of a search
`“Perfect lot CD—ROM Applications!
`
`lnfoSphere
`__7
`L 5
`Enhancing the mfllityoli-hmafioul
`PO Box 225, Pleasant Grove, UT 84062
`(801) 22l-5901 Fax (80]) 121-5903
`
`
`
`
`
`
`
`
`
`
`6
`
`
`
` I may not know MFC, but I know a little about listview
`
`about their extensive efforts to revise this book and make it
`
`better. I listened politely, but with a lot of skepticism. If a
`publisher makes little money on the first edition, the book is
`usually abandoned. If it makes decent money, pouring that
`money back into improving the book is often not a priority,
`and make no mistake about it — quality technical writing
`costs money. This book seemed to be selling well for WROX,
`which led me to expect only inexpensive cosmetic improve—
`ments in the second edition. 50 it was with at least a little
`
`dread that I opened the box containing the new version of
`the book. Boy, was I surprised!
`As soon as I opened the book, I knew something was very
`different I love books, down to the way they feel and smell (I
`hope this is not due to some kind of addictive glue used in the
`binding), and something felt very different from the previous
`edition. They were the same shape and weight, so I got out
`the old version to compare. The difference was immediately
`obvious — the new edition has much more information
`
`packed into approximately the same number of pages. How
`can that be? Simple: most programming books are padded
`with white space, code, screen shots, etc., to achieve the spe—
`cific bulk (900 pages in this case) desired. In this new edition,
`the margins shrank, the font shrank, and the amount of infor-
`mation grew. Okay, they replaced the padding with content,
`but was the quality any better? I chose a topic I knew some-
`thing about and that I was fairly sure the book would not
`cover well: listview controls.
`
`
`
`
`
`
`
`
`
`
`
`
`controls. They have one of the goofiest designs of any Con-
`trol Microsoft has ever made. When the listview control
`needs the text to draw a particular item, it sends you a nofi.
`fication, and you are supposed to return a pointer to the
`string containing the text. Think about that. Your window
`procedure gets called asynchronously and asked to return a
`pointer to text. Obviously, your text had better not reside in
`a stack variable, or the listview control will most likely
`have a little problem on its hands! Just how long are you
`supposed to ensure that that silly pointer is valid? In fact, a
`Knowledge Base note says you need to keep it valid until at
`least two more messages arrive. I am not making this up.
`Even more incredibly, none of the books I’ve seen that dis-
`cuss the listview control (see, for example, the clear but
`superficial Programming the Windows 95 User Interface, by
`Nancy Winnick Cluts) describe this fundamental problem
`in its design. Much to my surprise,
`the author clearly
`describes this problem in the section on how to use MFC
`with listview controls. To my delight, where I have been
`unable to devise a reasonable workaround for this ugly
`listview interface, the author provides a workaround that is
`simple, effective, and no more distasteful than the problem
`it has to solve. I definitely did not expect to find a very
`handy piece of generic Windows programming information
`in an MFC book!
`
`Now I was hooked — I then compared the two editions in
`detail to see what had been changed or added. Start with the
`book title: this is a book about MFC, and now the title reflects
`that. The chapter on application architecture hierarchy is
`mostly unchanged, though there are a few new (and wel—
`come) pages on startup issues (registry usage, command—line
`parsing, etc). The text on the crucial subject of the docu-
`ment/view architecture shows only minor changes, but the
`two figures that describe SDI and MDI class relationships are
`significantly improved. That may sound trivial, but I found
`these new figures useful enough to copy and display where I
`can see them. The OLE coverage is beefed up. The important
`topic of the Windows 95 common controls is larger and more
`detailed now; listview controls got 3 pages in the first edition,
`but get 13 pages of much denser text in the second edition.
`The chapter on using the new common controls with MFC is
`by itself more useful than some entire MFC books I’ve seen.
`The parts of the book that remain largely similar to the first
`edition often have minor improvements scattered here and
`there.
`
`Is there still room for improvement? There always is, but!
`believe that the most significant point about this book is that
`WROX made a substantial investment in quality. These folks
`spent time and money to improve the quality of a book that
`was probably already making a profit. Not broaden the
`scope, not make it appear fatter, but improve the qualitY-
`And they succeeded! This may not be the only book you'll
`ever need on MFC, but it’s the best one I've seen and the only
`one I’m willing to recommend so far. I hope that readers Will
`reward WROX’s effort by buying this book, instead of the
`many inferior MFC titles on the market. Maybe we as con-
`sumers can send the message that quality really is worth
`investing in.
`
`August 1996
`
`
`
`
`
`
`
`Tired of Wrestling with OCX/DLLs??
`
`
`
`
`
`
`Objective Grid
`
`You need SEC+ +Wand Objective Grid :two new Jl/IFC
`
`extensions that are 100% MFC compatible!
`an
`
`
`
`
`
`
`
`
` Objective Grid (pictured) is a complete grid MFC extension. You can use the grid in a
`CView, CWnd and even as a popup. The grid can be bound to any external data source
`with one virtual override. Objective Grid also features complete ODBC/DAO support, print
`preview. find/replace, undo/redo, UNICODE/DBCS and an extensible control architecture.
`SEC++ is a group of over 40 MFC extensions including: docking views, MDI alternatives,
`zooming and panning CViews, image classes for DIB/GIF/JPG/PCX/TGNTIFF, masked
`edit. calendar, collor well, menu button, excel-like tabbed windows, a filesystem class,
`encrypting and compressing CFile derivatives and much more.
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`Both products are VC++ 1.5x. 4.x compatible and come with full source code and no
`royalties Prices: Objective Grid: $395 SEC++: $495. Subscriptions available.
`
`www.5iingsofi.com
`
`
`
`"We Mid class In MFC!“
`
`
`
`Buy now and save a bundle... ii
`
`
`Stingray Software, Inc.
`Limited time offer: SEC++/Objective Grid '5
`Tel: (800) 9244223 l (919) 933-0363
`
`
`bundle for only 5795! Full source
`.
`Fax: (919) 933—0892
`code, no royalties. Order Today!
`
`
`All major credit cards accepted.
`
`Email: sales@stlngsoft.oom
`
`
`
`
`a Request Reader Service #150 o
`Page 64 — Windows Developer’s Journal
`
`7
`
`
`
`
`
`
`Teach Yourself Delphi 2 in 21 Days
`Dan Osier, Steve Grobman, and Steve Batson
`
`982 pages
`Sams Publishing, 1996
`$35.00
`ISBN 0-672—30863-0
`
`File3, Edit2, etc.), which makes even simple code difficult to
`understand. Although they discuss exceptions, they employ
`almost no error trapping/handling. The front cover says
`”Learn what you need to get the Wmdows 95 logo on your
`programs,” but the authors acknowledge that they cover only
`a few of the requirements.
`In general,
`the explanations are unclear. Chapter 7
`("Object-Oriented Programming") contains two pages of con-
`crete information and thirteen pages of an abstract discussion
`of ”software engineering” (Grady Booch is ”God of all that is
`Object Oriented”). The authors define modal only as ”a win-
`dow that pops up to provide or request information" and
`assert that it ”is not .
`.
`. your application’s primary window.”
`Chapter 7 addresses the issues of conserving resources and
`space, but "space” is defined as disk space (not memory), and
`”resources” are defined as CPU cycles (not Windows
`resources or memory). No indication is given about how to
`conserve either.
`
`When writing for novices, precision and consistency in
`word choice are crucial. But the authors call a procedure a
`function (in the section in which they attempt to distinguish
`between the two) and refer to the TextOut() method as a
`property; they call a check mark before a menu item a check—
`box (six pages later they discuss the checkbox control); they
`refer to visual and nonvisual components as “visible" and
`”invisible." They claim that the TTable and T0uery compo—
`nents are ”ancestors of a dataset class” (they’re descendants).
`The authors are also forgetful: in Chapter 14, they promise to
`
`OBJECT REPORTS
`
`this review was provided by George TylutkiJ
`[Editor's note:
`From the dedication (in which one author thanks 24 people
`and their families and another thanks his wife and dog in the
`same sentence) to the appendices (a five-page ASCII chart and
`a five-page ANSI chart), this is a bad book.
`The authors say that no ”prior knowledge of writing code
`is assumed,” and they do attempt to define things such as
`”subroutine” and “variable.” In Chapter 8, they even employ
`”Mr. DOS," ”Mr. Windows," and ”Mr. Win32” to explain the
`”operating systems that Microsoft has released.” However,
`so many items are not explained, and so much material is
`inaccurate, that a true novice will learn little. Of course, there
`are descriptions and illustrations of every menu item, tool-
`bar button, and option. But there is no logical development
`in the ”course” material; pointers (which can be avoided for
`the most part with Object Pascal) are discussed on the fourth
`day (before the Project Manager) and the Visual Component
`Library isn’t discussed until 250 pages into the book.
`Chapters 3 and 4 are a “Readers Digest version of the refer-
`ence manual."
`
`Each chapter ends with questions and exercises that are
`pedagogically unsound. Often, the reader cannot possibly
`answer the questions based on the information in the chap—
`ter. One ”exercise” is to run Borland’s tutorial. Another
`
`requires the student to ”create a database application that
`uses all the data—aware controls.” And ”to demonstrate drag-
`and—drop to yourself .
`.
`. open Explorer and drag a worthless
`text file onto the Recycle Bin (make sure to retrieve it if it was
`an important file).”
`'
`The quality of the authors’ code is poor. The errors are
`numerous and are typical of novices and former BASIC pro-
`grarruners; they include (but are not limited to) using double
`instead of single quotation marks, using variables before they
`have been initialized, and omitting semicolons. In Chapter 4,
`there are 29 chunks of code (complete listings or fragments in
`the text), eight of these won’t compile and three of which
`don’t do what the authors claim. For example, the line
`
`llhile (I 0 'q') or (I O '0'
`
`) DO
`
`makes a simple get-a-key program run forever. All of the code
`is simple and most is inefficient. It’s available from an Internet
`Site (no disk or CD is included). The book’s cover claims that it
`is ”Endorsed by Borland International Inc.” and “Approved
`for Technical Accuracy” by two Borland employees. Clearly,
`Borland’s imprimatur is no assurance of quality.
`In Chapter 5, the authors devote three pages to the impor-
`tance of using meaningful variable names, but fail to heed
`their own advice: they use Delphi’s default names (Buttonl,
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`STOPwaiting 10 minutes for a 2 page report!
`STOP coding your report logic in some slow,
`unfamiliar, interpreted macro language!
`STOP exporting your object-oriented databaseto a
`relational database just to produce reports!
`STOP wasting your time filling in gaps with DDE!
`STOP querying, filtering, and extracting temporary
`tables just to make your report writer happy!
`STOP creating simple reporting applications that
`require 5MB of diskspace and 8MB of RAM!
`STOP explaining to your users why your report writer
`can’t generate the reports they want!
`
`
`
`
`
`
`
`
`
`
`
`START using OBJECT REPORTS!
`Object Reports is not another report writer. Object
`Reports is a C++ class library that positions your data on
`the page. Create your reports layer by layer in C++.
`Code your entire report in C++. Preview the output.
`Works with any GUI library. Static- or dynamic-link.
`
`
`source code included!!!
`
`. Borland, Microsoft, Symantec
`16- and 32-bit Windows
`
`
`
`
`
`
`
`
`
`
`
` SMALL! FAST! EFFICIENT! FLEXIBLE! EXTENSIBLE! REUSABLE!
`
`
`
`ALIgust 1996
`
`Windows Developer‘s Journal —— Page 65
`
`Rollins Software Inc
`http://www.rollinssoft.com
`
`
`8
`
`
`
`
`
`
`
`
`
`
`
`
`
`discuss triggers in the next chapter, but don't; at the end of
`Chapter 16 they claim to have covered ”how to add graphs to
`your reports,” but they haven’t.
`In the Acknowledgments, the authors admit that the edi—
`tors made them feel ”like we were in English class again, but it
`was worth it!” In Chapter 18, they say that the ”Microsoft
`Developer’s Network CD .
`.
`. is the single largest wealth of
`information we have ever seen in one place” (what about a
`library?) Simply put, their writing skills are very weak. In
`addition to hundreds of punctuation, grammar, spelling and
`usage errors (89 fragments and run-0n sentences alone), the
`writing is vague, repetitious, and cliché.
`If it cost $2.95, I would recommend this book; it’s replete
`with howlers: ”code that bring tears of joy to my eye”; ”In my
`mind, there are two things that really stick out”; “I want to
`give you the big picture in an easily digestible format"; ”there
`always comes a time where you must print”; ”use properties .
`.
`. only if it is logical to do so. Methods .
`.
`. can be used any
`time”; ”Use the with statement auspiciously." Norm Crosby
`couldn’t have said it any better.
`In Chapter 18, which the authors refer to as ”merely a teas-
`er,” they address the important topic of how to pronounce
`”OLE 2” and conclude that ”it’s better to look and sound like
`
`you know what you're doing than actually doing anything."
`As with the book as a whole, I think I know what they’re say-
`ing here, but I’m not sure.
`
`Let’s Talk Books
`
`Subject: Review of Dynamics of Software Development