Showing memory contents into a HTMLView?
-
Hello... I'm using the Paul DiLascia's HTMLCtrl in my dialog based app. As I use this control in order to show variable information to the user I would like not to save the HTML generated into a file in order to send the path to the browser control... Is this possible? I would like to avoid the saving to the disc step. thank you in advance.
-
Hello... I'm using the Paul DiLascia's HTMLCtrl in my dialog based app. As I use this control in order to show variable information to the user I would like not to save the HTML generated into a file in order to send the path to the browser control... Is this possible? I would like to avoid the saving to the disc step. thank you in advance.
i fought with this problem for days. i finally came to the conclusion that it is not possible - many people on Google have come to the same conclusion. so, i create a temp file for the HTML and read it from there. -c
There's one easy way to prove the effectiveness of 'letting the market decide' when it comes to environmental protection. It's spelt 'S-U-V'. --Holgate, from Plastic
-
i fought with this problem for days. i finally came to the conclusion that it is not possible - many people on Google have come to the same conclusion. so, i create a temp file for the HTML and read it from there. -c
There's one easy way to prove the effectiveness of 'letting the market decide' when it comes to environmental protection. It's spelt 'S-U-V'. --Holgate, from Plastic
There is a not so nice way of doing so and I am sure there are limitations. Passing any text after the 'about:' protocol(?) in IE is diplayed in the browser. You can even put in links, font styles etc and IE will parse the text. as a quick example you can type the following text in the start/run dialog. about:Code Project I'm pretty sure you'll be limited (eventually) by the size of the URL. HTH Jignesh
-
There is a not so nice way of doing so and I am sure there are limitations. Passing any text after the 'about:' protocol(?) in IE is diplayed in the browser. You can even put in links, font styles etc and IE will parse the text. as a quick example you can type the following text in the start/run dialog. about:Code Project I'm pretty sure you'll be limited (eventually) by the size of the URL. HTH Jignesh
Brilliant! Simply brilliant! You just saved me from writing (and deleting) an ugly temp .htm file. :rose: /ravi Let's put "civil" back in "civilization" http://www.ravib.com ravib@ravib.com
-
Brilliant! Simply brilliant! You just saved me from writing (and deleting) an ugly temp .htm file. :rose: /ravi Let's put "civil" back in "civilization" http://www.ravib.com ravib@ravib.com
Thanks. But you should be aware of the max URL length that can be passed. I haven't tried this myself but if you look in wininet.h you see the following #defines #define INTERNET_MAX_PATH_LENGTH 2048 #define INTERNET_MAX_SCHEME_LENGTH 32 // longest protocol name length #define INTERNET_MAX_URL_LENGTH (INTERNET_MAX_SCHEME_LENGTH \ + sizeof("://") \ + INTERNET_MAX_PATH_LENGTH) I guess as long as your html text doesn't go over the #define you'll be ok. Jignesh
-
Thanks. But you should be aware of the max URL length that can be passed. I haven't tried this myself but if you look in wininet.h you see the following #defines #define INTERNET_MAX_PATH_LENGTH 2048 #define INTERNET_MAX_SCHEME_LENGTH 32 // longest protocol name length #define INTERNET_MAX_URL_LENGTH (INTERNET_MAX_SCHEME_LENGTH \ + sizeof("://") \ + INTERNET_MAX_PATH_LENGTH) I guess as long as your html text doesn't go over the #define you'll be ok. Jignesh
Good point. I guess it also pays to urlencode the text before checking its length. Thanks for making TakeStock[^] less ugly. :) /ravi Let's put "civil" back in "civilization" http://www.ravib.com ravib@ravib.com
-
Hello... I'm using the Paul DiLascia's HTMLCtrl in my dialog based app. As I use this control in order to show variable information to the user I would like not to save the HTML generated into a file in order to send the path to the browser control... Is this possible? I would like to avoid the saving to the disc step. thank you in advance.
Does this help? http://codeguru.earthweb.com/ieprogram/HtmlMemory.html[^] Dave.
-
There is a not so nice way of doing so and I am sure there are limitations. Passing any text after the 'about:' protocol(?) in IE is diplayed in the browser. You can even put in links, font styles etc and IE will parse the text. as a quick example you can type the following text in the start/run dialog. about:Code Project I'm pretty sure you'll be limited (eventually) by the size of the URL. HTH Jignesh
Hello, This can be a great solution, but I don't know how to launch the code to my HTMLCtrl... I'm using Paul DiLascia's HTMLCtrl (is directly derived from HTMLView), but I need to show the HTML "file" in that control not in a normal IE window. How do I launch that? Do I need to use a
system("about:MyHTMLCode")
call? If I do it in this way I won't be able to redirect MyHTMLCode to my HTMLCtrl because this would fire another instance of IE. Is there any better way to launch it? I've tried to pass this to the navigate instruction, but it hasn't worked for me:CString a = ""; a.Format("about:%s",csCodiHTML); this->m_HTMLCtrl.Navigate(a);
could you explain how to do it? Thank you in advance! -
Hello, This can be a great solution, but I don't know how to launch the code to my HTMLCtrl... I'm using Paul DiLascia's HTMLCtrl (is directly derived from HTMLView), but I need to show the HTML "file" in that control not in a normal IE window. How do I launch that? Do I need to use a
system("about:MyHTMLCode")
call? If I do it in this way I won't be able to redirect MyHTMLCode to my HTMLCtrl because this would fire another instance of IE. Is there any better way to launch it? I've tried to pass this to the navigate instruction, but it hasn't worked for me:CString a = ""; a.Format("about:%s",csCodiHTML); this->m_HTMLCtrl.Navigate(a);
could you explain how to do it? Thank you in advance!I tried the above with some simple HTML on a CHTMLView and not the HTMLCtrl (which should work the same though) and it worked. I can think of two things. 1) I used the Navigate2 method. 2) Is the URL VERY long? See the above threads on limitations. or you can try what someone else suggested (the atricle on codeguru). HTH Jignesh