Solved

Pass HTML memory block to IE Browser?

Posted on 2002-07-05
5
170 Views
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?

//LeprA
0
Comment
Question by:LeprA
  • 4
5 Comments
 
LVL 49

Accepted Solution

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

    http://www.experts-exchange.com/jsp/qManageQuestion.jsp?qid=20026971

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
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7133288
A couple of other techniques are covered here:
    http://www.experts-exchange.com/jsp/qShow.jsp?qid=20094394
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
0
 
LVL 49

Expert Comment

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

Author Comment

by:LeprA
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?

Thanks

//LeprA
0
 
LVL 49

Expert Comment

by:DanRollins
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
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

746 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now