Click here to Skip to main content
Click here to Skip to main content

Embedding an HTML Help window into a dialog

By , 1 Feb 2000
 
  • Download demo project - 48 Kb
  • Sample Image - html_help.jpg

    CHHCtrl is an MFC class designed for placing an embedded help window inside of a dialog, property sheet, or window. The CHHCtrl class hosts shdocvw directly rather then using the HtmlHelp API. This bypasses the bugs in embedded help introduced with the version of HTML Help released with Visual Studio 6. It also gives you access to all IWebBrowser methods which means you can change HTML files on the fly -- for example, showing the actual key associations currently in effect for a program rather then the default set it ships with.

    This project also includes a CItsFile class that you can use for reading any file from a CHM (or ITS) file. It is used by the CHHCtrl class for convertting mapped ids into URLs, but you can use it to read any kind of data that is stored in the CHM file.

    Because of additions to MFC that CHHCtrl relies on, this project requires Visual Studio 6. You may be able to port it to an earlier version of Visual Studio, but expect a fair amount of work.

    The zip file includes additional information (chhctrl.htm) covering how to add CHHCtrl into your project, and documents other functionality that CHHCtrl provides.

    License

    This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

    A list of licenses authors might use can be found here

    About the Author

    Ralph Walden
    Web Developer
    United States United States
    Member
    No Biography provided

    Sign Up to vote   Poor Excellent
    Add a reason or comment to your vote: x
    Votes of 3 or less require a comment

    Comments and Discussions

     
    You must Sign In to use this message board.
    Search this forum  
        Spacing  Noise  Layout  Per page   
    GeneralProblem when using Visual Studio 2005memberHolger Farr19 May '06 - 1:34 
    When I build the demo program using Visual Studio 2005 I get an assertion in file occcont.cpp:950 (ASSERT(IsWindow(pTemp->m_hWnd));). When ignoring the assertion everything works fine but I get some memory leaks. Any hints how I can solve this problem?
    GeneralRe: Problem when using Visual Studio 2005memberkishoresoftware18 Apr '08 - 8:57 
    Hi,
    Did you find any solution to this issue?
     
    Thanks,
    Kishore
    GeneralRe: Problem when using Visual Studio 2005memberHolger Farr20 Apr '08 - 23:52 
    Hello,
     
    unfortunately I haven't found a solution and the problem still exists in VS2008. (OK, I have to admit that I didn't search too much.) In my application I removed CHHCtrl control and switched to a control, that converts HTML to RTF ( http://www.viksoe.dk/code/simplehtmlviewer.htm[^]) which works fine for my needs.
    Bye
    Holger
    GeneralRe: Problem when using Visual Studio 2005memberfeelapi24 Feb '10 - 18:44 
    In vs2008 sp1, I fix this by replace the code in function

    bool CHHCtrl::ReplaceControl(CWnd* pDlg, UINT idCtrl, DWORD dwBtns, LPCTSTR pszHomeURL, bool fBtnText)

     
    the 4th line code:

    pDlg->GetDlgItem(idCtrl)->DestroyWindow()

     
    to
     

    pDlg->GetDlgItem(idCtrl)->ShowWindow(SW_HIDE);

    GeneralDisabling File drop in this type of dialogmemberWolfram Steinke30 Jan '06 - 8:59 
    How can one disable the Drop in particular when using the IWebBrowser2 control. I am using it in places where it is inappropriate to able to drop a file on it.
    Setting the Allowfiles to false seems not to work.
     
    Any suggestions would be appreciated.

     
    Happy programming!!
    QuestionHTMLHelp from another PC ?memberSaviPpp5 Oct '05 - 1:01 
    Hello,
     
    I start my app from another PC in LAN, and then when I try to launch HtmlHelp for the app, help window shows, but without content. It seems like .chm file has problem with finding .htm pages compiled in it.
    Is there a way to solve this problem?
     

    AnswerRe: HTMLHelp from another PC ?membersnowlin30 Sep '08 - 19:49 
    This is a million year old question that doesn't seem to have been answered. In case you're someone like me wandering around the articles and would like to know the solution for this poster issues, perhaps I can help.
     
    If what he is describing is this: a .chm file that has been opened on another computer and it was copied over from a LAN or even sent to you via email (or some other method) does not display content. It actually may show a web type error like "this page cannot be displayed..yada yada".
     

    Quoted from Dr. eXplain [^]
    A security update for Windows XP® may block access to CHM files
    Windows XP® security update blocks active content in CHM files to protect your system security. Additional information is available here.
     
    Solution: Run Windows Explorer, right-click on the CHM file, and select Properties from the popup menu. Click on the Unblock button immediately below the Advanced button on the General page. Click Apply to show the content. Once the CHM file has been unblocked, the Unblock button disappears.
     
    The CHM file is in the restricted Internet zone
    When a CHM file that you are trying to access is stored remotely, e.g. on the network drive or on a remote server, you may also get in trouble. If the associated security zone is restricted, then CHM files won't be displayed as well.
     
    Solution: Please go to Dr. eXplain's website[^] for details

     
    I've listed the two most common reasons for the error but the website explains several more and their solutions.
     
    I hope this helps someone.
     
    S.Nowlin
    -----------------------
    I'm a Techwriter Monkey -- handy, just less useful than the Bathroom Monkey.

    QuestionHow to get the default topic?membersamson_duan31 Jul '05 - 17:02 
    Hi,
    If missing [MAP] section in the CHM file,How can I display CHM using the CHHCtrlclass?
     
    Thx in advance Poke tongue | ;-P
    Questionwhat a crap?sussbuzz0073 May '05 - 6:51 
    this is so called article?
    AnswerRe: what a crap?memberRavi Bhavnani3 May '05 - 7:51 
    Do you have a constructive comment or are you just having a bad day?
     
    /ravi
     
    My new year's resolution: 2048 x 1536
    Home | Articles | Freeware | Music
    ravib@ravib.com

    General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

    Permalink | Advertise | Privacy | Mobile
    Web04 | 2.6.130523.1 | Last Updated 2 Feb 2000
    Article Copyright 2000 by Ralph Walden
    Everything else Copyright © CodeProject, 1999-2013
    Terms of Use
    Layout: fixed | fluid