ID: Q113188
The information in this article applies to:
This article contains a list of errors in the text of the book "Inside OLE 2," by Kraig Brockschmidt (Microsoft Press).
Many of the errors listed below also affect the book's sample code; the descriptions for those errors include references to another Knowledge Base article, which describes the problems (and their solutions) in more detail.
For additional information on these problems and their solutions, please see the following article(s) in the Microsoft Knowledge Base:
ARTICLE-ID: Q113255
TITLE : SAMPLE: Corrections for Inside OLE 2 Sample Code
The sample code for "Inside OLE 2" was originally written to be compatible
with OLE 2.0. This code has been updated to be compatible with OLE 2.01,
and also to fix some problems in the original code. The entire source tree
for the updated sample code is included in the INOLE2 Software Library
sample. INOLE2 can be found in the Microsoft Software Library by searching
on the word INOLE2.
Page 71: The second line of the last paragraph should read "with all the
functions in the preceding table...". The book has "tale"
instead of "table".
Pages 82- The exact implementations of CImpIEnumRECT::Next on these pages
83, 92- are incorrect--for more information, see the section "Errors in
93: Enumerator Samples" in the Knowledge Base article "SAMPLE:
Corrections for Inside OLE 2 Sample Code."
Also, on page 83 there should be no space between "book" and
"1632" in the text "#include <book 1632.h>".
Page 105: The second use of QueryInterface in the Transitive property
should read "pInterface2->QueryInterface(IInterface3)". The
book has IInterface2 as the parameter to QueryInterface,
which is incorrect.
Page 157: A space is missing between "LPLPVOID" and "ppv" in the
last parameter of the declaration CKoala::QueryInterface.
Page 161: The prototype for WEP should return an int, not VOID.
Page 197: The line of code under "if (IsEqual(riid, IID_IAnimal))"
should read "*ppv=(LPVOID)m_pAnimal". In the text the
underscore is mistakenly a space, dash, and space.
Page 199: A space is missing between "LPLPVOID" and "ppv" in the
last parameter of the declaration CKoala::QueryInterface.
Page 243: The second sentence in the second paragraph should read:
"The Structured Storage definition of IStream allows streams
to contain up to 2^64 (2 raised to the 64th power)
addressable bytes of data."
The text incorrectly reads "264" instead of "2^64."
Pages 257- The code listings for CPages::DevModeSet, CPages::DevModeGet,
259: and CPages::ConfigureForDevice should be changed to correct a
problem with certain printer drivers in Patron. For more
information on this problem, see the section "Patron Does Not
Work with Some Printer Drivers" in the Knowledge Base article
"SAMPLE: Corrections for Inside OLE 2 Sample Code."
Pages 289- Both LibMain and WEP functions should return an int.
290: For more information, see the section "Incorrect Prototypes for
LibMain() and WEP()" in the Knowledge Base article "SAMPLE:
Corrections for Inside OLE 2 Sample Code."
Page 316: The implementation of CImpIEnumFormatEtc::Next is incorrect.
For more information on this problem, see the section "Errors in
Enumerator Samples" in the Knowledge Base article "SAMPLE:
Corrections for Inside OLE 2 Sample Code."
Page 331: The description of IDataObject::GetCanonicalFormatEtc
is incorrect. For correct details, see the Microsoft Object
Linking and Embedding version 2.0 "Programmer's Reference."
Page 365: The "const LPRECTL" parameter to IViewObject::Draw
should be of type "LPCRECTL" to match OLE 2.01. The book
is correct for OLE 2.0. For more information, see the section
"Compiler Errors on IViewObject::Draw()" in the Knowledge
Base article "SAMPLE: Corrections for Inside OLE 2 Sample Code."
Page 368: The call to pIViewObject->Draw about should read:
"pIViewObject->Draw(dwAspect, -1, NULL, NULL, 0, hdcDraw,
lprcBounds, NULL, NULL, 0);". In the book, the dwAspect and
hDC parameters are incorrect.
Page 399: When CImpIDataObject::GetData calls AddRef() before returning,
it should also call AddRef on any IStorage or IStream pointer
inside the STGMEDIUM, if that is the medium in use. For more
information, see the section "Datatran Reference Counting
Problem" in the Knowledge Base article "SAMPLE: Corrections
for Inside OLE 2 Sample Code."
Page 437: The word "consumer" in the caption of Figure 8-6 should be
"target."
Pages 544- In OLE 2.01 there is a new, additional parameter to
546: OleUIAddVerbMenu called "idVerbMax", which comes immediately
after "idVerbMin." This parameter was not present in OLE 2.0.
For information on how this change affects the sample code, see
the section "Compiler Errors on OleUIAddVerbMenu" in
the Knowledge Base article "SAMPLE: Corrections for Inside
OLE 2 Sample Code."
Page 554: Under OLE 2.01 the OleStdGetObjectDescriptorFromOleObject
function (used in the Patron sample application) requires an
additional LPSIZEL as the last parameter. For more information
on how this change affects the sample code, see the section
"Compiler Errors on OleStdGetObjectDescriptorFromOleObject()"
in the Knowledge Base article "SAMPLE: Corrections for Inside
OLE 2 Sample Code."
Pages 614- No ellipsis ("...") is necessary to separate functions in
622: Listing 10-5. There is no code omitted from the listing in these
places.
Page 630: The right curly brace just above the "else" at the bottom
of the page should be indented to align with the call
to ModifyMenu above it.
Pages 663- The bottom of page 663 mentions how a handler should hold
665: onto open streams for low-memory save situations. This is
important ONLY for elements that are entirely manipulated
by the handler and never touched by the server. The handler
should not cache or hold pointers to the same elements the
server must access. For more information on this problem, see
the section "Component Cosmo Fails to Release Polyline Object"
in the Knowledge Base article "SAMPLE: Corrections for Inside
OLE 2 Sample Code."
If a handler manipulates and changes data unaffected by
the server, it must fulfill the IPersistStorage contract for
only those formats. The server is responsible for all
others that it modifies.
Page 668: The "const LPRECTL" parameter to IViewObject::Draw
should be of type "LPCRECTL" to match OLE 2.01. The book
is correct for OLE 2.0. For more information on how this change
affects the sample code, see the section "Compiler Errors on
IViewObject::Draw()" of the Knowledge Base article "SAMPLE:
Corrections for Inside OLE 2 Sample Code."
Page 687: There should not be "//" before the large bold "IOLEOBJ.CPP"
in this code listing. The label is not part of the code.
Page 788: Same problem with OleStdGetObjectDescriptorFromOleObject
as described above for page 554.
Page 814: Same problem with OleUIAddVerbMenu as described above for
pages 544-546.
Page 817: Remove the second parameter to pTenantCur->Close. It should
read "pTenantCur->Close(FALSE);". For more information on this
problem, see the section "Patron GP Faults During Activate As"
in the Knowledge Base article "SAMPLE: Corrections for Inside
OLE 2 Sample Code."
Page 817: There should be a call to pIStorage->Commit(STGC_ONLYIFCURRENT)
immediately after the call to OleStdDoConvert and before
the call to pIStorage->Release. For more information, see
the section "Patron Convert To Fails" of the Knowledge Base
article "SAMPLE: Corrections for Inside OLE 2 Sample Code."
Page 819: Remove the second parameter to pTenantCur->Close. It should
read "pTenantCur->Close(FALSE);". This matches the change
necessary for a bug resolution described in the section "Patron
GP Faults During Activate As" in the Knowledge Base article
"SAMPLE: Corrections for Inside OLE 2 Sample Code."
Page 846: The parenthetical entry in the fourth line of the last
paragraph should read "(linked objects are NOT allowed...)".
The book reads "now" instead of "not".
Page 861: The second sentence of the third paragraph under "Active
vs. UI Active and Inside-Out Objects" should read:
"The answer...as they are visible-end users DO NOT have to
double-click..."
The DO NOT is important.
NOTE: Versions of "Inside OLE 2" printed after March 1994 (third printing
or later) have been corrected.
Additional reference words: 2.01 mspress docerr KBCategory: kbole kbdocerr KBSubcategory: LeTwoOth
Last Reviewed: April 21, 1995