Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Pro VB 6
|
Pro VB 6 For advanced Visual Basic coders working in version 6 (not .NET). Beginning-level questions will be redirected to other forums, including Beginning VB 6.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 16th, 2007, 09:35 AM
Authorized User
 
Join Date: Jul 2007
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default Launching HTML Help in VB6

Hi,

I am trying to launch our software application help file in VB6. Initially, we had generated a ".hlp" Help file. We tested it and it worked fine under Windows XP. However, Windows Vista no longer supports ".hlp" format Help file. So, we ended up compiling and generating a ".chm" HTML Help file.

Now we are running into a problem, which is that the HTML ".chm" Help format can be launched from a VB app. in Windows Vista, but not in Windows XP. Another strange thing is that in Windows XP, I can double click on the ".chm" Help file and it will launch and open. Also, from within my VB6 app, I can generate an error message box (MsgBox) and invoke help with a proper context ID and am able to launch the HTML ".chm" Help file. I'm wondering if this is because we are using an older Microsoft Common Dialog Control library in VB6. The version we are currently using is MS Common Dialog Control SP6. I tried searching the net last night, but could not find a link anywhere for a newer version.

Does anyone have any ideas or thoughts on this problem? We really appreciate any leads on this.

Thank you very much for all your help.

Khoi Nguyen
__________________
Khoi Nguyen
 
Old October 16th, 2007, 02:28 PM
Authorized User
 
Join Date: Jul 2007
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi all,

I did some research and found the following solution that works great. For the whole time, I was stuck in thinking that it's the problem with the MS Common Dialog Control. Well, the answer is that if you want to launch an HTML ".chm" Help file from VB6, you would not use MS Common Dialog Control at all.

VB provides an API function called "HTMLHelp". To gain access to this function, you will need to provide the following declaration:

Private Declare Function HTMLHelp Lib "HHCtrl.ocx" Alias "HTMLHelpA" _
    (ByVal hWndCaller As Long, _
     ByVal pszFile As String, _
     ByVal uCommand As Long, _
     ByVal dwData As Long) As Long

To use it, try the following:

HtmlHelp hWnd, "HHDemo.chm", HH_HELP_CONTEXT, ByVal 100&

where the constants are defined as follows:

Const HH_DISPLAY_TOPIC As Long = 0
Const HH_HELP_CONTEXT As Long = &HF
Const HH_DISPLAY_TOC = &H1

For more information, you can reference Microsoft knowledge base Article 315988 thru the following link:

http://support.microsoft.com/kb/315988/en-us

Thanks to everyone for reading my post.

Have a nice day,

Khoi.

Khoi Nguyen





Similar Threads
Thread Thread Starter Forum Replies Last Post
Launching Crystal reports from a Gridview redbull8vodka Crystal Reports 0 January 26th, 2007 06:45 AM
problem with two pages launching Diggers33 Flash (all versions) 2 January 25th, 2007 07:39 AM
VB6 HTML Help bwhit VB How-To 1 May 13th, 2006 03:04 AM
Launching Apps from VB?? PeteS Beginning VB 6 2 June 20th, 2003 01:23 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.