Cry about...
Delphi Troubleshooting


File not found: SHDocVw.dcu


Symptom:

When compiling a unit a "uses" clause generates the following error:

[Fatal Error] File not found: 'SHDocVw.dcu'

Cause:

The unit TSHDocVw provides access to the TWebBrowser control (for example IHTMLDocument2). This unit is typically provided as part of the installation for Delphi, but only for the Professional versions. So this error can arise when trying to compile on a different machine.

Remedy:

The solution is to change the code to instead use SHDocVw_TLB, which is the name of the appropriate import file that is generated by Delphi when the Microsoft Internet Control active-X component is imported.

So change:

uses SHDocVw;

to

uses SHDocVw_TLB;

If the error changes to:

[Fatal Error] File not found: 'SHDocVw.dcu'

then follow the instructions here How to install TWebBrowser.


These notes are believed to be correct for Delphi 6 and Delphi 7, but may apply to other versions as well.



About the author: is a dedicated software developer and webmaster. For his day job he develops websites and desktop applications as well as providing IT services. He moonlights as a technical author and consultant.