Re: Reading the source of a HTML file, which is displayed by a webbrowser control
"Bendix Koopmann" <freak5@freak5.de> wrote in message
news:6lz7iziutm65.1aoye6ickmxxu.dlg@40tude.net
When a resource-bound HTML file refers to an image, such as
"pagerror.gif", this image should also be a resource with the name
"pagerror.gif" and the type 2110, as you can see in shdoclc.dll
That's the part I understand (surprisingly I looked for the image
pageerror.gif, too), but I didn't manage to name them. My resources
always get IDs not names.
In the IDE, select the resource in Resource View, hit Alt+Enter to get
to Properties window. In the ID field, enter the string ID in quotes,
e.g. "pagerror.gif" .
How can I specify my type of resource HTML files as a part of the
res://URL?
http://msdn.microsoft.com/workshop/networking/predefined/res.asp
Because my problem is that I always loaded my HTML
resources, which were saved as .txt files, by locking them and
copying them byte by byte into a string. Somehow this does not work,
if the files are stored as html files.
When you say "doesn't work", what exactly fails and how?
char*
Buff=(char*)LockResource(LoadResource(0,FindResource(0,MAKEINTRESOURCE(ID),"TEXT"))
);
Is the resource type correct? I would have expected RT_HTML for HTML
files, not "TEXT".
The string, I get after using this code, is copied into a stream and
the stream is sent to the webbrowser. The links to images look like
"about:blankIMAGE.gif" or "res://GIF.GIF/" if you look at the
properties of the broken images.
Of course. These are relative URLs, and would only work if the base URL
is correct. Why don't you just navigate to the res: URL?
I wonder if there is a funktion like loadBitmap(), which has to load
the HTML Webpage.
Because if I load it into a string, the webbrowser can't know that it
receives a resource, which is part of the res://URL.
See if this helps:
http://groups.google.com/group/microsoft.public.inetsdk.programming.html_objmodel/browse_frm/thread/fa57f1eebf880388
But I still don't understand why you wouldn't just navigate the browser
to res:// URL.
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925