C Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesC Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old March 31st, 2002, 01:39 AM
MJEggertson MJEggertson is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jan 2002
Location: Seattle WA
Posts: 863 MJEggertson User rank is Corporal (100 - 500 Reputation Level)MJEggertson User rank is Corporal (100 - 500 Reputation Level)MJEggertson User rank is Corporal (100 - 500 Reputation Level)MJEggertson User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 22 sec
Reputation Power: 8
[MFC] Browsing the HTML DOM in C++

Hi all, this is a problem I've been struggling with for about two weeks or so, and I can't seem to find any resources to help me that don't assume you have a PhD in computer lingo. If you saw my similar question, please forgive this thread. I'm just so very stumped, and figured I had to give it one last try, in case some one who know this stuff didn't see my post at the end of my other thread.

I'm not going to post much code, since I may be going wrong really early on. Consider this: I have my CHTMLView derived view for my application. In its OnNavigateComplete2 function, I get the IDispatch pointer to the HTML Document, and query it for the interface to the HTML Document:

Code:
void CMyHtmlView::OnNavigateComplete2(LPCTSTR strURL) 
{
    CHtmlView::OnNavigateComplete2(strURL);

    // Get the document's IDispatch pointer.
    IDispatch* pIDisp = GetHtmlDocument();

    // Obtain a pointer to the IHTMLDocument2 interface.
    IHTMLDocument2* pIHTMLDoc2 = NULL;
    HRESULT hr;
    hr = pIDisp->QueryInterface(IID_IHTMLDocument2, (void**) &pIHTMLDoc2);
    if (SUCCEEDED (hr))
    {
        GetHTMLElements(pIHTMLDoc2);
        pIHTMLDoc2->Release();
    }
    pIDisp->Release();
}


void CMyHtmlView::GetHTMLElements(IHTMLDocument2* p)
{
    // Obtain a pointer to the HTMLElements interface.
    IHTMLElementCollection* pIHTMLElements = NULL;
    HRESULT hr;
    hr = p->get_all(&pIHTMLElements);
    if (SUCCEEDED(hr))
    {
        SetElements(pIHTMLElements);
        p->Release();
    }
}


This is pretty much all that I know is definitely working. I need to do alot of things from the SetElements function, but for now, I'll settle with being able to read the name/value of any single element in the collection. For the life of me, I can't seem to do it. My problem, I believe, is I don't know how to use the proper string classes. I can't figure out what to do with functions prototyped like:

Code:
foo->get_name(BSTR* p)


I know I'm in over my head here, but I really want to do this. I spent an hour or so at the bookstore, trying to find a good book to help me, but they're all rather advanced, and basically geared to people who want to learn how to write COM interfaces and such. I have no desire to do that, I only want to learn how to *use* this interface (I'm not a programmer by trade). COM and ATL come up alot in the literature I've seen. Is knowing these things really necessary to do what I want to do?

-Mike

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesC Programming > [MFC] Browsing the HTML DOM in C++


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway