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

  • Home
  • SEARCH
  • 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 6875127
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:16:55+00:00 2026-05-27T04:16:55+00:00

In my C++ app I’m embedding (via COM) a web browser (Internet Explorer) control

  • 0

In my C++ app I’m embedding (via COM) a web browser (Internet Explorer) control (CLSID_WebBrowser).

I can display my own html in that control by using IHTMLDocument2::write() method but if the html has <img src="foo.png"> element, it’s not displayed.

I assume there is a way for me to provide the data for foo.png somehow to the web control, but I can’t find the right place to hook this functionality?

I need to be in full control of providing the content of foo.png, so work-arounds like using res:// protocol or saving to disk and using file:// protocol are not good enough. I just want to plug my code somehow so that when embedded CLSID_WebBrowser control sees <img src="foo.png"> in html data given with IHTMLDocument2::write() it will ask me to provide this data.

  • 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. Editorial Team
    Editorial Team
    2026-05-27T04:16:56+00:00Added an answer on May 27, 2026 at 4:16 am

    To answer my own question, the solution that finally worked for me is:

    1. register custom IInternetProtocol/IInternetProtocolInfo/ via custom IClassFactory given to IInternetSession::RegisterNameSpace(). For reasons that seem like a bug to me, it has to be a protocol already known to IE (I’ve chosen “its”) even though it would be much better if it was my own, unique namespace.

    2. feed html data via custom IMoniker through IPersistentMoniker::Load() and make sure that IMoniker::GetDisplayName() (which is a base url according to which relative links in provided html will be resolved) starts with that protocol scheme (in my case “its://”). That way relative link “foo.png” in the html data will be its://foo.png to IE which will make urlmon call IInternetProtocol::Start() and IInternetProtocol::Read() to ask for the data for that url.

    This is all rather complicated, you can look at the actual (BSD-licensed) code here:
    http://code.google.com/p/sumatrapdf/source/browse/trunk/src/utils/HtmlWindow.cpp

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

Sidebar

Related Questions

App Engine only allows you to use these formats for XMPP addresses: app-id@appspot.com anything@app-id.appspotchat.com
My app is installed via NSIS. I want the installer to install the program
Web app runs on Tomcat. Datasource is configured with Spring configuration, and is used
My app allows users to have custom subdomains, as in user1.domain.com. I am integrating
my app has a submit feedback form. Is there a way to can capture
My app must report its job load via HTTP API. The play status command
Web app is being written in classic ASP with a MSSQL backend. On this
app.config <system.net> <mailSettings> <smtp deliveryMethod=Network> <network defaultCredentials=false host=smtp.gmail.com password=aaa port=587 userName=noreplay@aaa.si /> </smtp> </mailSettings>
My app has many controls on its surface, and more are added dynamically at
An app I'm writing always crashes on a clients computer, but I don't get

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.