I have in memory the content of xml file which refers to xslt file on disk. I am trying to force the browser to display this content. But it doesn't work as I expected! :(( Otherwise if I save this content as temporary file on disk and make browser to navigate to new location everything is fine. So can you answer me what to do to make things workings without making temporary file?! Best regards, Alex
ReplyOriginally posted by: John
Hello,
I have taken the sample for a memory html into a dll, where the first call to it succeeds, but a second navigation to the resource from a new instance of the class causes an access violation in urlmon.dll when navigate2 is called.
Anyone else experience a similar problem ?
Is the resource getting locked ?
Thanks,
John
Originally posted by: Hung N
I used this to load a Unicode text, then I don't understand why all the links with <A HREF... are not activated, the text seemed to be displayed as pur plain text in black, with only bigger size for <H?> tags but no color or links
Any idea ?
ReplyOriginally posted by: Bhavesh Patel
Hi Sir,
I want a program that can process HTML form. CGI Sort of programming.
With Regards..
Bhavesh
Originally posted by: oren
When i use the component (as a part of MDI app) and try right clicking on it and change the encoding nothing happends (ie the page reloads so i get another download complete event, but the encoding doesn't change).
any ideas ?
Oren
ReplyOriginally posted by: Oleg Schildt
I read your article and thought, maybe you can give me a hint on my problem solution.
I am making an IE add-in so called SmartViewers for multiple surfing. It is an alternative solution to the tabbed view. The pages are loaded into small browser windows that are found in a bar docked on the left to the main browser (like history and search). The contents of small windows is shown zoomed like it is in the Windows Explorer in the WEB mode. By clicking the small window, its contents and that of the main browser is swapped. My problem is that I can not find a more efficient solution for contents swapping than just simple re-navigation.
My bar is a COM object that is integrated into IE through a tool button. I have access to the IWebBrowser2 interface of the main browser and so to all other available interfaces.
The small windows are WebBrowser controls created as follows. CWnd::CreateControl(CLID_WebBrowser...)
I tried to swap contents using IPersistStream Save/Load, IOleObject GetClientSite/SetClientSite, but nothing really worked.
I would appritiate any ideas or suggestions.
Best regards
Hi,
Originally posted by: Nom De Plume
Simply do the following:
void CDerivedClass::setHTML(CString html)
GetDHtmlDocument(&pDoc);
if ( htmlBStr != NULL )
pBody->Release();
Simply call like this:
setHTML("<HTML><BODY>Test!!!</BODY></HTML>");
Note: I have omitted checking of return values in the
IF all you want to do is change the HTML of your
control there is a much simpler way. More importantly
it is compatible with IE 4.0+
{
IHTMLDocument2* pDoc = NULL;
IHTMLElement* pBody = NULL;
BSTR htmlBStr = html.AllocSysString();
pDoc->get_body(&pBody);
pBody->put_innerHTML(htmlBStr);
SysFreeString(htmlBStr);
pDoc->Release();
}
code for clarity, however, you should certainly do this.
Also this code works for a CDHTMLDialog derived class,
but you can modify it for any class that can return an
IHTMLDocument2 object by using the appropriate function
in place of the GetDHtmlDocument call above.
Originally posted by: Sander Verhagen
Note that m_browser is a variable of type CWebBrowser2;
<CODE>
// Get the browser
// Get the html document
// Get the body element
// Put content to body element
Good luck with it! It works here just fine, but took me
Yours,
Hi,
I've gone through some trouble to also dynamically load
style information for the 'virtual' document that is being
displayed. Here is some code that might help others too, in
doing so.
Maybe this is not the best COM code in existence, but
it's working fine for me!
thus a web browser control in a dialog.
HRESULT hr;
IWebBrowser2* pBrowserApp;
LPUNKNOWN lpUnk = m_browser.GetControlUnknown();
hr = lpUnk->QueryInterface(IID_IWebBrowser2, (void**)&pBrowserApp);
if(FAILED(hr)) return;
// Get the browser contents
LPDISPATCH lpDispatch;
hr = pBrowserApp->get_Document(&lpDispatch);
if(FAILED(hr)) return;
if(!lpDispatch) return;
IHTMLDocument3* pHtmlDoc;
hr = lpDispatch->QueryInterface(IID_IHTMLDocument2, (void**)&pHtmlDoc);
if(FAILED(hr)) return;
IHTMLElement *pBodyElement;
hr = pHtmlDoc->get_documentElement(&pBodyElement);
if(FAILED(hr)) return;
CString c = "body {background: yellow;}"; // etcetera
CComBSTR body( c );
pBodyElement->put_innerHTML(body);
</CODE>
three nights to get... so please re-use it ;-)
Sander
Originally posted by: SA
I put "<frameset>" tag to MSHTML.
I tried,,,
1.put_body
2.IHTMLDocument2::write
But "FrameSet" tag didn't insert.
#1. "FrameSet" Tag wasn't inserted.
#2. "FrameSet" Tag was inserted,But Page is blank.
I think hardly.I ask to many people.
But The problem does resolve.
Please tell me & help !!!!
Originally posted by: Eric
Thanks for sharing. This is what I'm looking for.
Anyway, when I run in debug mode, I see a warning like this.
Warning: constructing COleException, scode = DISP_E_MEMBERNOTFOUND ($80020003).
First-chance exception in MoreHtmlViewDemo.exe (KERNEL32.DLL): 0xE06D7363: Microsoft C++ Exception.
Anyone has a clue why and is there a way to fix it.
Thanks in advance.
Eric
Reply