Microsoft KB Archive/113188: Difference between revisions

From BetaArchive Wiki
(importing KB archive)
 
m (Text replacement - """ to """)
Line 64: Line 64:
=== List of Text Errors ===
=== List of Text Errors ===


<pre class="fixed_text">Page 71:  The second line of the last paragraph should read &quot;with all the
<pre class="fixed_text">Page 71:  The second line of the last paragraph should read "with all the
           functions in the preceding table...&quot;. The book has &quot;tale&quot;
           functions in the preceding table...". The book has "tale"
           instead of &quot;table&quot;.
           instead of "table".


Pages 82-  The exact implementations of CImpIEnumRECT::Next on these pages
Pages 82-  The exact implementations of CImpIEnumRECT::Next on these pages
83, 92-    are incorrect--for more information, see the section &quot;Errors in
83, 92-    are incorrect--for more information, see the section "Errors in
93:        Enumerator Samples&quot; in the Knowledge Base article &quot;SAMPLE:
93:        Enumerator Samples" in the Knowledge Base article "SAMPLE:
           Corrections for Inside OLE 2 Sample Code.&quot;
           Corrections for Inside OLE 2 Sample Code."
           Also, on page 83 there should be no space between &quot;book&quot; and
           Also, on page 83 there should be no space between "book" and
           &quot;1632&quot; in the text &quot;#include &lt;book 1632.h&gt;&quot;.
           "1632" in the text "#include &lt;book 1632.h&gt;".


Page 105:  The second use of QueryInterface in the Transitive property
Page 105:  The second use of QueryInterface in the Transitive property
           should read &quot;pInterface2-&gt;QueryInterface(IInterface3)&quot;. The
           should read "pInterface2-&gt;QueryInterface(IInterface3)". The
           book has IInterface2 as the parameter to QueryInterface,
           book has IInterface2 as the parameter to QueryInterface,
           which is incorrect.
           which is incorrect.


Page 157:  A space is missing between &quot;LPLPVOID&quot; and &quot;ppv&quot; in the
Page 157:  A space is missing between "LPLPVOID" and "ppv" in the
           last parameter of the declaration CKoala::QueryInterface.
           last parameter of the declaration CKoala::QueryInterface.


Page 161:  The prototype for WEP should return an int, not VOID.
Page 161:  The prototype for WEP should return an int, not VOID.


Page 197:  The line of code under &quot;if (IsEqual(riid, IID_IAnimal))&quot;
Page 197:  The line of code under "if (IsEqual(riid, IID_IAnimal))"
           should read &quot;*ppv=(LPVOID)m_pAnimal&quot;. In the text the
           should read "*ppv=(LPVOID)m_pAnimal". In the text the
           underscore is mistakenly a space, dash, and space.
           underscore is mistakenly a space, dash, and space.


Page 199:  A space is missing between &quot;LPLPVOID&quot; and &quot;ppv&quot; in the
Page 199:  A space is missing between "LPLPVOID" and "ppv" in the
           last parameter of the declaration CKoala::QueryInterface.
           last parameter of the declaration CKoala::QueryInterface.


Page 243:  The second sentence in the second paragraph should read:
Page 243:  The second sentence in the second paragraph should read:


           &quot;The Structured Storage definition of IStream allows streams
           "The Structured Storage definition of IStream allows streams
           to contain up to 2^64 (2 raised to the 64th power)
           to contain up to 2^64 (2 raised to the 64th power)
           addressable bytes of data.&quot;
           addressable bytes of data."


             The text incorrectly reads &quot;264&quot; instead of &quot;2^64.&quot;
             The text incorrectly reads "264" instead of "2^64."


Pages 257- The code listings for CPages::DevModeSet, CPages::DevModeGet,
Pages 257- The code listings for CPages::DevModeSet, CPages::DevModeGet,
259:      and CPages::ConfigureForDevice should be changed to correct a
259:      and CPages::ConfigureForDevice should be changed to correct a
           problem with certain printer drivers in Patron. For more
           problem with certain printer drivers in Patron. For more
           information on this problem, see the section &quot;Patron Does Not
           information on this problem, see the section "Patron Does Not
           Work with Some Printer Drivers&quot; in the Knowledge Base article
           Work with Some Printer Drivers" in the Knowledge Base article
           &quot;SAMPLE: Corrections for Inside OLE 2 Sample Code.&quot;
           "SAMPLE: Corrections for Inside OLE 2 Sample Code."


Pages 289- Both LibMain and WEP functions should return an int.
Pages 289- Both LibMain and WEP functions should return an int.
290:      For more information, see the section &quot;Incorrect Prototypes for
290:      For more information, see the section "Incorrect Prototypes for
           LibMain() and WEP()&quot; in the Knowledge Base article &quot;SAMPLE:
           LibMain() and WEP()" in the Knowledge Base article "SAMPLE:
           Corrections for Inside OLE 2 Sample Code.&quot;
           Corrections for Inside OLE 2 Sample Code."


Page 316:  The implementation of CImpIEnumFormatEtc::Next is incorrect.
Page 316:  The implementation of CImpIEnumFormatEtc::Next is incorrect.
           For more information on this problem, see the section &quot;Errors in
           For more information on this problem, see the section "Errors in
           Enumerator Samples&quot; in the Knowledge Base article &quot;SAMPLE:
           Enumerator Samples" in the Knowledge Base article "SAMPLE:
           Corrections for Inside OLE 2 Sample Code.&quot;
           Corrections for Inside OLE 2 Sample Code."


Page 331:  The description of IDataObject::GetCanonicalFormatEtc
Page 331:  The description of IDataObject::GetCanonicalFormatEtc
           is incorrect. For correct details, see the Microsoft Object
           is incorrect. For correct details, see the Microsoft Object
           Linking and Embedding version 2.0 &quot;Programmer's Reference.&quot;
           Linking and Embedding version 2.0 "Programmer's Reference."


Page 365:  The &quot;const LPRECTL&quot; parameter to IViewObject::Draw
Page 365:  The "const LPRECTL" parameter to IViewObject::Draw
           should be of type &quot;LPCRECTL&quot; to match OLE 2.01. The book
           should be of type "LPCRECTL" to match OLE 2.01. The book
           is correct for OLE 2.0. For more information, see the section
           is correct for OLE 2.0. For more information, see the section
           &quot;Compiler Errors on IViewObject::Draw()&quot; in the Knowledge
           "Compiler Errors on IViewObject::Draw()" in the Knowledge
           Base article &quot;SAMPLE: Corrections for Inside OLE 2 Sample Code.&quot;
           Base article "SAMPLE: Corrections for Inside OLE 2 Sample Code."


Page 368:  The call to pIViewObject-&gt;Draw about should read:
Page 368:  The call to pIViewObject-&gt;Draw about should read:


           &quot;pIViewObject-&gt;Draw(dwAspect, -1, NULL, NULL, 0, hdcDraw,
           "pIViewObject-&gt;Draw(dwAspect, -1, NULL, NULL, 0, hdcDraw,
           lprcBounds, NULL, NULL, 0);&quot;. In the book, the dwAspect and
           lprcBounds, NULL, NULL, 0);". In the book, the dwAspect and
           hDC parameters are incorrect.
           hDC parameters are incorrect.


Line 136: Line 136:
           it should also call AddRef on any IStorage or IStream pointer
           it should also call AddRef on any IStorage or IStream pointer
           inside the STGMEDIUM, if that is the medium in use. For more
           inside the STGMEDIUM, if that is the medium in use. For more
           information, see the section &quot;Datatran Reference Counting
           information, see the section "Datatran Reference Counting
           Problem&quot; in the Knowledge Base article &quot;SAMPLE: Corrections
           Problem" in the Knowledge Base article "SAMPLE: Corrections
           for Inside OLE 2 Sample Code.&quot;
           for Inside OLE 2 Sample Code."


Page 437:  The word &quot;consumer&quot; in the caption of Figure 8-6 should be
Page 437:  The word "consumer" in the caption of Figure 8-6 should be
           &quot;target.&quot;
           "target."


Pages 544- In OLE 2.01 there is a new, additional parameter to
Pages 544- In OLE 2.01 there is a new, additional parameter to
546:      OleUIAddVerbMenu called &quot;idVerbMax&quot;, which comes immediately
546:      OleUIAddVerbMenu called "idVerbMax", which comes immediately
           after &quot;idVerbMin.&quot; This parameter was not present in OLE 2.0.
           after "idVerbMin." This parameter was not present in OLE 2.0.
           For information on how this change affects the sample code, see
           For information on how this change affects the sample code, see
           the section &quot;Compiler Errors on OleUIAddVerbMenu&quot; in
           the section "Compiler Errors on OleUIAddVerbMenu" in
           the Knowledge Base article &quot;SAMPLE: Corrections for Inside
           the Knowledge Base article "SAMPLE: Corrections for Inside
           OLE 2 Sample Code.&quot;
           OLE 2 Sample Code."


Page 554:  Under OLE 2.01 the OleStdGetObjectDescriptorFromOleObject
Page 554:  Under OLE 2.01 the OleStdGetObjectDescriptorFromOleObject
Line 155: Line 155:
           additional LPSIZEL as the last parameter. For more information
           additional LPSIZEL as the last parameter. For more information
           on how this change affects the sample code, see the section
           on how this change affects the sample code, see the section
           &quot;Compiler Errors on OleStdGetObjectDescriptorFromOleObject()&quot;
           "Compiler Errors on OleStdGetObjectDescriptorFromOleObject()"
           in the Knowledge Base article &quot;SAMPLE: Corrections for Inside
           in the Knowledge Base article "SAMPLE: Corrections for Inside
           OLE 2 Sample Code.&quot;
           OLE 2 Sample Code."


Pages 614- No ellipsis (&quot;...&quot;) is necessary to separate functions in
Pages 614- No ellipsis ("...") is necessary to separate functions in
622:      Listing 10-5. There is no code omitted from the listing in these
622:      Listing 10-5. There is no code omitted from the listing in these
           places.
           places.


Page 630:  The right curly brace just above the &quot;else&quot; at the bottom
Page 630:  The right curly brace just above the "else" at the bottom
           of the page should be indented to align with the call
           of the page should be indented to align with the call
           to ModifyMenu above it.
           to ModifyMenu above it.
Line 173: Line 173:
           should not cache or hold pointers to the same elements the
           should not cache or hold pointers to the same elements the
           server must access. For more information on this problem, see
           server must access. For more information on this problem, see
           the section &quot;Component Cosmo Fails to Release Polyline Object&quot;
           the section "Component Cosmo Fails to Release Polyline Object"
           in the Knowledge Base article &quot;SAMPLE: Corrections for Inside
           in the Knowledge Base article "SAMPLE: Corrections for Inside
           OLE 2 Sample Code.&quot;
           OLE 2 Sample Code."


           If a handler manipulates and changes data unaffected by
           If a handler manipulates and changes data unaffected by
Line 182: Line 182:
           others that it modifies.
           others that it modifies.


Page 668:  The &quot;const LPRECTL&quot; parameter to IViewObject::Draw
Page 668:  The "const LPRECTL" parameter to IViewObject::Draw
           should be of type &quot;LPCRECTL&quot; to match OLE 2.01. The book
           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
           is correct for OLE 2.0. For more information on how this change
           affects the sample code, see the section &quot;Compiler Errors on
           affects the sample code, see the section "Compiler Errors on
           IViewObject::Draw()&quot; of the Knowledge Base article &quot;SAMPLE:
           IViewObject::Draw()" of the Knowledge Base article "SAMPLE:
           Corrections for Inside OLE 2 Sample Code.&quot;
           Corrections for Inside OLE 2 Sample Code."


Page 687:  There should not be &quot;//&quot; before the large bold &quot;IOLEOBJ.CPP&quot;
Page 687:  There should not be "//" before the large bold "IOLEOBJ.CPP"
           in this code listing. The label is not part of the code.
           in this code listing. The label is not part of the code.


Line 199: Line 199:


Page 817:  Remove the second parameter to pTenantCur-&gt;Close. It should
Page 817:  Remove the second parameter to pTenantCur-&gt;Close. It should
           read &quot;pTenantCur-&gt;Close(FALSE);&quot;. For more information on this
           read "pTenantCur-&gt;Close(FALSE);". For more information on this
           problem, see the section &quot;Patron GP Faults During Activate As&quot;
           problem, see the section "Patron GP Faults During Activate As"
           in the Knowledge Base article &quot;SAMPLE: Corrections for Inside
           in the Knowledge Base article "SAMPLE: Corrections for Inside
           OLE 2 Sample Code.&quot;
           OLE 2 Sample Code."


Page 817:  There should be a call to pIStorage-&gt;Commit(STGC_ONLYIFCURRENT)
Page 817:  There should be a call to pIStorage-&gt;Commit(STGC_ONLYIFCURRENT)
           immediately after the call to OleStdDoConvert and before
           immediately after the call to OleStdDoConvert and before
           the call to pIStorage-&gt;Release. For more information, see
           the call to pIStorage-&gt;Release. For more information, see
           the section &quot;Patron Convert To Fails&quot; of the Knowledge Base
           the section "Patron Convert To Fails" of the Knowledge Base
           article &quot;SAMPLE: Corrections for Inside OLE 2 Sample Code.&quot;
           article "SAMPLE: Corrections for Inside OLE 2 Sample Code."


Page 819:  Remove the second parameter to pTenantCur-&gt;Close. It should
Page 819:  Remove the second parameter to pTenantCur-&gt;Close. It should
           read &quot;pTenantCur-&gt;Close(FALSE);&quot;. This matches the change
           read "pTenantCur-&gt;Close(FALSE);". This matches the change
           necessary for a bug resolution described in the section &quot;Patron
           necessary for a bug resolution described in the section "Patron
           GP Faults During Activate As&quot; in the Knowledge Base article
           GP Faults During Activate As" in the Knowledge Base article
           &quot;SAMPLE: Corrections for Inside OLE 2 Sample Code.&quot;
           "SAMPLE: Corrections for Inside OLE 2 Sample Code."


Page 846:  The parenthetical entry in the fourth line of the last
Page 846:  The parenthetical entry in the fourth line of the last
           paragraph should read &quot;(linked objects are NOT allowed...)&quot;.
           paragraph should read "(linked objects are NOT allowed...)".
           The book reads &quot;now&quot; instead of &quot;not&quot;.
           The book reads "now" instead of "not".


Page 861:  The second sentence of the third paragraph under &quot;Active
Page 861:  The second sentence of the third paragraph under "Active
           vs. UI Active and Inside-Out Objects&quot; should read:
           vs. UI Active and Inside-Out Objects" should read:


           &quot;The answer...as they are visible-end users DO NOT have to
           "The answer...as they are visible-end users DO NOT have to
           double-click...&quot;
           double-click..."


           The DO NOT is important.
           The DO NOT is important.

Revision as of 11:32, 20 July 2020

Knowledge Base


Article ID: 113188

Article Last Modified on 7/10/2001



APPLIES TO

  • Microsoft OLE 2.01



This article was previously published under Q113188

SUMMARY

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:

113255 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 Microsoft Download Center Inole2.exe sample. You can download Inole2.exe from the above-mentioned Microsoft Knowledge Base article.

MORE INFORMATION

List of Text Errors

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 that are printed after March 1994 (which is the third printing or later) have been corrected.


Additional query words: 2.01 mspress docerr

Keywords: kbbug kbdocfix kbdocerr KB113188