HELP ME TO FIND AN ERROR
-
I'm trying to connect to IE events, and made quick & dirty demo ( it's here ). TROUBLE: when I'm getting document object of the IE frame, in which loaded document from another domain (not the same as top-level frame), an error occurs. And I can't to handle it correctly!! In debug mode message box with kernel exception popups... Demo Usage: 1) Run IE 2) Type address of page with frames from different domains ( www.search.msn.com for ex. ) 3) Press "Connect to OnMouseMove Button". When connected, if you will track mouse hover the doc, you woll listen short beeps. Help me to correctly handle an error in debug mode, when trying to access documents at search.msn.com and similar sites!!! Thanks!
-
I'm trying to connect to IE events, and made quick & dirty demo ( it's here ). TROUBLE: when I'm getting document object of the IE frame, in which loaded document from another domain (not the same as top-level frame), an error occurs. And I can't to handle it correctly!! In debug mode message box with kernel exception popups... Demo Usage: 1) Run IE 2) Type address of page with frames from different domains ( www.search.msn.com for ex. ) 3) Press "Connect to OnMouseMove Button". When connected, if you will track mouse hover the doc, you woll listen short beeps. Help me to correctly handle an error in debug mode, when trying to access documents at search.msn.com and similar sites!!! Thanks!
I run it, and nothing happens, just beeps. Can you give me more details what to do? P.S. in void CIEEnumWindowsDlg::OnVs() after you initialize smart pointer MSHTML::IHTMLDocument2Ptr spHtmlDocument(spDisp); add this line to check if wrapped pointer is vaid: if(spHtmlDocument == NULL) return; Samething is here
MSHTML::IHTMLWindow2Ptr spFrame;
//...
spFrame = varFrame;//assignment , spFrame may be NULL if
//varFrame.pdispVal interface can not be queryed for MSHTML::IHTMLWindow2 interface.. Make sure after you initialize typed smart pointers by assigning an interface pointer or in constructor check it fo NULL. soptest
-
I'm trying to connect to IE events, and made quick & dirty demo ( it's here ). TROUBLE: when I'm getting document object of the IE frame, in which loaded document from another domain (not the same as top-level frame), an error occurs. And I can't to handle it correctly!! In debug mode message box with kernel exception popups... Demo Usage: 1) Run IE 2) Type address of page with frames from different domains ( www.search.msn.com for ex. ) 3) Press "Connect to OnMouseMove Button". When connected, if you will track mouse hover the doc, you woll listen short beeps. Help me to correctly handle an error in debug mode, when trying to access documents at search.msn.com and similar sites!!! Thanks!
You got E_ACCESSDENIED COM exception, because of IE security design.
try{ spFrameDoc = spFrame->document; } catch(\_com\_error e) { TRACE("Äîêóìåíò íåäîñòóïåí!\\n"); }
Cross-Frame Scripting and Security
With Dynamic HTML (DHTML), content in different windows and frames can interact in powerful ways by scripting with the object model. However, since a browser can simultaneously display unrelated documents in its various windows and frames, certain rules must be enforced to protect data integrity and privacy of information.
This article describes how and why these restrictions apply in the DHTML Object Model. All rules about script interaction apply equally to windows, dialog boxes, FRAMESETs, FRAMEs, and IFRAMEs.
For most content, only interactions with content from the same domain are allowed. For example, a typical page on www.microsoft.com can freely script content on any other page on www.microsoft.com, but cannot script to pages that are located on a different Web domain. The DHTML Object Model uses the document.domain property to enforce this restriction: only pages with identical domain properties are allowed free interaction. The protocol of the URL must also match. For instance, an HTTP page cannot access HTTPS content.
The range of permissible access for a page can be expanded when a script assigns the document.domain property to a suffix of the site name space, up to the second-level domain. For example, a page on www.microsoft.com can assign the document.domain property—initially www.microsoft.com—as microsoft.com to broaden access to include pages in home.microsoft.com or any other site, as long as the other pages also set the document.domain property to the identical value. Since only pages from a site whose name ends with microsoft.com will permit this domain to be set, it is assured that content from the same provider mutually agrees to interact and is free to do so. Domain suffixes shorter than the second-level domain (such as just "com") are not allowed, because they expose beyond a single provider. For international site names, such as www.microsoft.co.jp, the second-lev
-
You got E_ACCESSDENIED COM exception, because of IE security design.
try{ spFrameDoc = spFrame->document; } catch(\_com\_error e) { TRACE("Äîêóìåíò íåäîñòóïåí!\\n"); }
Cross-Frame Scripting and Security
With Dynamic HTML (DHTML), content in different windows and frames can interact in powerful ways by scripting with the object model. However, since a browser can simultaneously display unrelated documents in its various windows and frames, certain rules must be enforced to protect data integrity and privacy of information.
This article describes how and why these restrictions apply in the DHTML Object Model. All rules about script interaction apply equally to windows, dialog boxes, FRAMESETs, FRAMEs, and IFRAMEs.
For most content, only interactions with content from the same domain are allowed. For example, a typical page on www.microsoft.com can freely script content on any other page on www.microsoft.com, but cannot script to pages that are located on a different Web domain. The DHTML Object Model uses the document.domain property to enforce this restriction: only pages with identical domain properties are allowed free interaction. The protocol of the URL must also match. For instance, an HTTP page cannot access HTTPS content.
The range of permissible access for a page can be expanded when a script assigns the document.domain property to a suffix of the site name space, up to the second-level domain. For example, a page on www.microsoft.com can assign the document.domain property—initially www.microsoft.com—as microsoft.com to broaden access to include pages in home.microsoft.com or any other site, as long as the other pages also set the document.domain property to the identical value. Since only pages from a site whose name ends with microsoft.com will permit this domain to be set, it is assured that content from the same provider mutually agrees to interact and is free to do so. Domain suffixes shorter than the second-level domain (such as just "com") are not allowed, because they expose beyond a single provider. For international site names, such as www.microsoft.co.jp, the second-lev
Thanks. It's a strange thing occured. Yesterday, catch operator don't helped me (was Exception MessageBox). Today it works, both code:
try{spFrameDoc = spFrame->document; }
catch(_com_error e)
{
TRACE("Doc unavailable! %s\n", e.ErrorMessage());
}try{spFrameDoc = spFrame->document; }
catch(...)
{
TRACE("Doc unavailable!\n");
}:eek: And pair questions more. 1) Under debugger I saw
First-chance exception in IEEnumWindows.exe (KERNEL32.DLL): 0xE06D7363: Microsoft C++ Exception.
Is it correct? (I handled it). 2) Is it means, that it's impossible to access certain documents for my app? Or there is any way to pass security troubles?
-
Thanks. It's a strange thing occured. Yesterday, catch operator don't helped me (was Exception MessageBox). Today it works, both code:
try{spFrameDoc = spFrame->document; }
catch(_com_error e)
{
TRACE("Doc unavailable! %s\n", e.ErrorMessage());
}try{spFrameDoc = spFrame->document; }
catch(...)
{
TRACE("Doc unavailable!\n");
}:eek: And pair questions more. 1) Under debugger I saw
First-chance exception in IEEnumWindows.exe (KERNEL32.DLL): 0xE06D7363: Microsoft C++ Exception.
Is it correct? (I handled it). 2) Is it means, that it's impossible to access certain documents for my app? Or there is any way to pass security troubles?
This kind of stuff happens all the time.. It looks scary, but I think it's stuff that either the kernel or link/loader is doing. Try debugging any application and you'll see tons of these messages (at least in VC 6) FreeBSD is sexy. << This space for rent >>