Microsoft KB Archive/233398

= PRB: Common Dialog ShowHelp Method does not Work with CHM Files =

Article ID: 233398

Article Last Modified on 5/13/2003

-

APPLIES TO


 * Microsoft Visual Basic 6.0 Learning Edition
 * Microsoft Visual Basic 6.0 Professional Edition
 * Microsoft Visual Basic 6.0 Enterprise Edition

-



This article was previously published under Q233398



SYMPTOMS
When attempting to display a Help file using the Microsoft Common Dialog Control 6.0, the following error message is displayed:

The filename file is not a Windows Help file, or the file is corrupted.



CAUSE
The ShowHelp method launches WinHelp32.exe, which does not support HTML based help files.



RESOLUTION
To open an HTML based help file from Visual Basic it is necessary to call the HtmlHelp API function.



STATUS
This behavior is by design.



Steps to Reproduce Behavior
 Open a new Visual Basic Standard EXE project. Form1 is created by default. From the Project menu, choose Components and then select "Microsoft Common Dialog Control 6.0". Next, click OK. Site a Common Dialog control on Form1.  Add the following code to the General Declarations section of Form1: Private Sub Form_DblClick CommonDialog1.HelpFile = "c:\winnt\help\vbsetup.chm" CommonDialog1.HelpCommand = cdlHelpContents CommonDialog1.ShowHelp End Sub  Modify the path and file name in the second line of code to point to an existing .chm file on your system.</li> Run the application and double-click Form1. The error message described in the SYMPTOMS section occurs.</li></ol>

<div class="references_section">