Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Pass HTML memory block to IE Browser?

Posted on 2002-07-05
Medium Priority
Last Modified: 2010-04-01
Is there a way to pass a memoryblock containing a HTML page to an browser instead of creating a temporary file that the IE browser reads from?

Question by:LeprA
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
LVL 49

Accepted Solution

DanRollins earned 600 total points
ID: 7133277
The simplest technique is described here:

It boils down to opening a dummy page and then filling the innerHTML of the DOM 'body' element with your in-memory HTML.

There are other ways, but this is very easy to implement and will work in nearly all cases.  When there are images and so forth, you must provide a correct URL or file path for each (obviously, such objects are not actually part of the HTML source and the browser needs to obtain and load them separately).

-- Dan
LVL 49

Expert Comment

ID: 7133288
A couple of other techniques are covered here:
including how to put the whole page -- including images and other external objects -- into a resource in a DLL or the EXE that hosts the browser control.

-- Dan
LVL 49

Expert Comment

ID: 7137238
hi LeprA,
Do you have any additional questions?  Do any comments need clarification?
-- Dan

Author Comment

ID: 7140032
Yea sure i have,

I just wondered if il have the whole page inc Head- and Meta-tags in lets say a string is there a way to pass it to the IHTMLDocument2 or must i separete it into Head and Body by my self?

These questions did appear then i was using IXSLProcessor i thougt it was stupid to make an output to a file if il already have it in memory.

Maybe you have used it, and know a smoth way?


LVL 49

Expert Comment

ID: 7140104
Sure!  It's all available in the DOM -- there's a HUGE section on these things in MSDN.  Give it a try!
-- Dan

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question