Microsoft KB Archive/169433: Difference between revisions
m (Text replacement - ">" to ">") |
m (Text replacement - """ to """) |
||
Line 12: | Line 12: | ||
<div id="TitleRow"> | <div id="TitleRow"> | ||
= <span id="KB169433"></span>PRB: #import | = <span id="KB169433"></span>PRB: #import "shdocvw.dll" / tagREADYSTATE compile errors = | ||
Line 86: | Line 86: | ||
These errors are generated because of the inclusion of the tagReadyState definition in Ocidl.idl (included by the .idl for shdocvw).<br /> | These errors are generated because of the inclusion of the tagReadyState definition in Ocidl.idl (included by the .idl for shdocvw).<br /> | ||
<br /> | <br /> | ||
Including tagReadyState in Ocidl.idl causes tagReadyState to be included in the type library for Shdocvw.dll. In turn, #import | Including tagReadyState in Ocidl.idl causes tagReadyState to be included in the type library for Shdocvw.dll. In turn, #import "shdocvw.dll" includes the definition of tagReadyState in the generated headers for Shdocvw.dll. This definition collides with the definition of tagReadyState in Ocidl.h. | ||
</div> | </div> | ||
Line 94: | Line 94: | ||
The exclude attribute of the #import directive can be used to work around this problem. Use #import shdocvw.dll as follows: | The exclude attribute of the #import directive can be used to work around this problem. Use #import shdocvw.dll as follows: | ||
<pre class="codesample">#import <shdocvw.dll> exclude( | <pre class="codesample">#import <shdocvw.dll> exclude("tagREADYSTATE") | ||
</pre> | </pre> | ||
The tagReadyState will be defined for your project through the inclusion of Ocidl.h. | The tagReadyState will be defined for your project through the inclusion of Ocidl.h. |
Latest revision as of 11:04, 21 July 2020
Article ID: 169433
Article Last Modified on 7/18/2001
APPLIES TO
- Microsoft Internet Explorer 4.0 128-Bit Edition
- Microsoft Visual C++ 5.0 Enterprise Edition
- Microsoft Visual C++ 5.0 Professional Edition
This article was previously published under Q169433
SYMPTOMS
When using the #import compiler directive to import Shdocvw.dll, several errors similar to the following will be reported:
When using the #import compiler directive with the no_namespace attribute to import Shdocvw.dll, several errors similar to the following will be reported:
CAUSE
These errors are generated because of the inclusion of the tagReadyState definition in Ocidl.idl (included by the .idl for shdocvw).
Including tagReadyState in Ocidl.idl causes tagReadyState to be included in the type library for Shdocvw.dll. In turn, #import "shdocvw.dll" includes the definition of tagReadyState in the generated headers for Shdocvw.dll. This definition collides with the definition of tagReadyState in Ocidl.h.
RESOLUTION
The exclude attribute of the #import directive can be used to work around this problem. Use #import shdocvw.dll as follows:
#import <shdocvw.dll> exclude("tagREADYSTATE")
The tagReadyState will be defined for your project through the inclusion of Ocidl.h.
STATUS
This behavior is by design.
REFERENCES
Visual C++ Preprocessor Reference: The #import directive
Keywords: kberrmsg kbwebbrowser kbprb kbfaq KB169433