What API required to access HTML tag of a chm file in MFC program????

Hello,
I like to write an MFC program that will have to check the value of an html tag (<meta>) in a chm file. So I like to know what MFC class and method is required to use to have my program access the html tag value of a chm file Any idea pls
Thanks.


Answer this question

What API required to access HTML tag of a chm file in MFC program????

  • Andrei Kossoroukov

     vcboy wrote:
    I can't have chm file shown on web browser in my program. So, is there any way to get MSHTML document object without using web browser control

    Yes.  You can use

    HRESULT IHTMLDocument2::put_URL(BSTR v); 

    As described here

    http://msdn.microsoft.com/library/default.asp url=/workshop/browser/mshtml/reference/reference.asp

    Not sure if it's possible to prevent an IE window from popping up.   Shall investigate further and get back to you later. As a last resort, just use the Web Browser control in a hiddden state ;)

    Regards

       Sahir


  • Nathan-Vindicator

    Thank you very much Sahir. Your codes enlighten me to have some idea for my program, but I can't have chm file shown on web browser in my program. So, is there any way to get MSHTML document object without using web browser control I appreciate your valuable answer.

  • RobinP

    Another way to do it is to use mshtml to parse the chm file. This can be particularly useful if you want to display the chm file in your application's window. You can use the web browser control to display the chm file and then use it's GetDocument method to create the MSHTML document object.


    void CCHMTestDlg::OnButton1()
    {
    m_WebBrowser.Navigate("ms-its:http://127.0.0.1/calc.chm::/calc_whatis_intro.htm",
    NULL, NULL, NULL, NULL);
    MSHTML::IHTMLDocument2Ptr doc(m_WebBrowser.GetDocument());
    }

    Once you have a handle to to the document object you can parse the page by iterating through the document's html element collection.

    Regards

    Sahir


  • Naveen Kohli

  • What API required to access HTML tag of a chm file in MFC program????