Board index » cppbuilder » TCppWebBrowser problem
Eyyub Volkan Çektimur
![]() CBuilder Developer |
TCppWebBrowser problem2005-01-25 10:29:09 PM cppbuilder77 I want to browse an html page, produced dynamiclly. I put a TCppWebBrowser component (WB) then i called the WB->Navigate(StringToOleStr("about:blank")); function on form show (to initialize web browser). then on button click; ------------------------------------------------------ void __fastcall THTMLViewerW::Button1Click(TObject *Sender) { TMemoryStream* HTMLStream=new TMemoryStream(); // fill the HTMLStream ... Mem->LoadFromFile("d:/progs/htmlview/SEP Output Template_page2.htm"); // for example IPersistStreamInit* pPersistStreamInit = NULL; TStreamAdapter *IStr=new TStreamAdapter(HTMLStream,soReference); WB->ControlInterface->get_Document()->QueryInterface( IID_IPersistStreamInit, (void**)&pPersistStreamInit); pPersistStreamInit->InitNew(); pPersistStreamInit->Load(*IStr); pPersistStreamInit->Release(); pPersistStreamInit=NULL; } ------------------------------------------------------ this works well , the problem is , sometimes the web browser component shows the html source (not the html page - like to navigate a .txt file) . but it is an html source (starts with <html>..... ). I think ie component couldn't understand is it a html or something other type of source. i need to produce source dynamically , so i couldn't navigate to html file. but i tried to navigate the same source via file ; WB->Navigate(StringToOleStr("file:/d:/progs/htmlview/SEP Output Template_page2.htm")); html shown as it is. do you have any idea for this situation ? maybe i need to sign the source as html , but i don't know how to ? thanks for help ... -- ________________________________________ Eyyub Volkan Çektimur Proya Software & Trade Inc. Head of Core Development Department |