Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HTML Loading from resource - How?

Status
Not open for further replies.

Robertus

Programmer
Feb 16, 2001
81
RO
Hi, there!

I'm in deep trouble with that nasty WebBrowser!
All I want to do is to create some
HTML-based presentation pages in an dialog-based application that has an WebBrowser ActiveX control in it.
And I wish all those pages loaded from resources so I could distribute only the executable file,
without any other .htm files.

The piece of code that loads my HTMLs is this:

CxxxDlg::OnInitDialog(...)
{
....................
COleVariant* p_url=new COleVariant(CString("C:\\My Projects\\XxxApp\\Slides\\welcome.htm"));
COleVariant noVariant;
m_ie.Navigate2(p_url,&noVariant,&noVariant,&noVariant,&noVariant);
delete p_url;
....................
}

Everything works just fine!

But I have to distribute the "welcome.htm" together with my .exe and this is something that I don't like.

(A few months ago I have created an SDI app whose View class was derived from CHtmlView and
that class ( CHtmlView ) had a simple function called LoadFromResource(UINT id) that
did the job for me, BUT the WebBrowser control that comes with VC++ 6.0 DOESN'T HAVE THAT
FUNCTION, so I tried to load it somehow else, but I'm giving up! And I'm sure there's something
simple but I can't figure out WHAT ????????)

That's the first part of the problem. The second one is this: let's suppose that somehow I managed to
load an HTML-resource named IDR_FIRST_HTML. What code should this IDR_FIRST_HTML contain inside it
so that it could link to another HTML-resource named IDR_SECOND_HTML?

<A HREF=&quot;?????????????????&quot;>Go to next Page</A>

Please if you had the time then try to write a simple DIALOG BASED app that does this and
maybe you could send it to me, or if you hadn't the necessary time I would be pleased just with
that piece of code with the right modifications and the <A>...</A> tag implementation.


Thank you in advance!
 
You can handling &quot;LoadFromResource&quot; Function derived

CHtmlView class!


It's usage that Let's see next Line


BOOL LoadFromResource( LPCTSTR lpszResource );

=> LoadFromResource(your Resource name);
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top