Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 111775
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T02:26:23+00:00 2026-05-11T02:26:23+00:00

When programming in C++ against the browser’s DOM each engine has a different set

  • 0

When programming in C++ against the browser’s DOM each engine has a different set of interfaces, IE has the COM based [MSHTML](http://msdn.microsoft.com/en-us/library/aa752279(VS.85).aspx), Mozilla has the XPCOM based Gecko DOM etc.

Is there a common API that has adapters for major browsers (and versions)?


As a clarification, the application in question is a desktop application written in C++ which interacts with browsers, currently we have separate code bases for support of IE and Mozilla and I’m trying to reduce duplications of logic and allow adding new browsers with less effort.

A concrete example can be getting the innerHTML property of an HTML element.

// Firefox nsAutoString html; nsCOMPtr<nsIDOMNSHTMLElement> elem = do_QueryInterface(obj); if (elem)     elem->GetInnerHTML(html);   // IE CComBSTR html; MSHTML::IHTMLElementPtr elem = obj; if (elem)       elem->get_innerHTML(&html); 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T02:26:24+00:00Added an answer on May 11, 2026 at 2:26 am

    Your best bet seems to be to define your own interface and write different adapters. In the likeliness that your C++ code won’t be employing all DOM traversing capabilities, your interface will only have to define a compact set of traversal functions.

    As a bonus of defining your own interface, you can easily write a mock adapter for your unit testing.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 80k
  • Answers 80k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer try using this: http://ipv4.fiddler/folder instead of http://localhost/folder this also works… May 11, 2026 at 4:21 pm
  • Editorial Team
    Editorial Team added an answer Victor, Your question is a duplicate so I think you… May 11, 2026 at 4:21 pm
  • Editorial Team
    Editorial Team added an answer Hard to say anything more insightful than "yes, you're right."… May 11, 2026 at 4:21 pm

Related Questions

When programming in C++ against the browser's DOM each engine has a different set
When programming in C++ in Visual Studio 2008, why is there no functionality like
When programming in C++, I use Doxygen and frequently create external .dox files for
I am a newbie in C++ programming. When compiling I never use any option.
I am programming in C++ for many years, still I have doubt about one

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.