Click here to Skip to main content
15,901,205 members
Home / Discussions / COM
   

COM

 
GeneralRe: why do have to restart to get excel/ word application. every time Pin
SHaroz18-Jul-02 6:16
SHaroz18-Jul-02 6:16 
GeneralRe: why do have to restart to get excel/ word application. every time Pin
pnpfriend18-Jul-02 6:52
pnpfriend18-Jul-02 6:52 
GeneralRe: why do have to restart to get excel/ word application. every time Pin
SHaroz18-Jul-02 7:14
SHaroz18-Jul-02 7:14 
GeneralRe: why do have to restart to get excel/ word application. every time Pin
pnpfriend18-Jul-02 8:26
pnpfriend18-Jul-02 8:26 
GeneralRe: why do have to restart to get excel/ word application. every time Pin
soptest18-Jul-02 9:57
soptest18-Jul-02 9:57 
GeneralHELP ME TO FIND AN ERROR Pin
Alex Cramer17-Jul-02 23:59
Alex Cramer17-Jul-02 23:59 
GeneralRe: HELP ME TO FIND AN ERROR Pin
soptest18-Jul-02 8:06
soptest18-Jul-02 8:06 
GeneralRe: HELP ME TO FIND AN ERROR Pin
soptest18-Jul-02 9:38
soptest18-Jul-02 9:38 
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-level domain for widest access would be "microsoft.co.jp" (not "co.jp").

Since it is important to be able to navigate windows or frames to any URL beyond the domain restriction, these types of accesses are always permitted. Only access that attempts to read out or modify content is restricted. For instance, the href property might be assigned to cause navigation to occur, but this property cannot be read if the URL is of a different domain. This would allow one page to learn where the user has been browsing, and to allow this is a breach of the user's privacy. Some restrictions that apply to pages of different domains include:

  • window.location.href Property can be set to navigate, but cannot be read.
  • Other window.location.href Functionality is blocked.
  • document.location.href Property can be set to navigate, but cannot be read.
  • Other document.location.href Functionality is blocked.
  • IFRAME property can be set to navigate, but cannot be read.
  • Scripts that attempt to access parts of the object model to which they do not have access are blocked with a "permission denied" error.

    While domain security can prevent certain types of content interaction, it is important to understand that this restriction is necessary to ensure security. For example, without domain security, a rogue page could "snoop" on another page or, using DHTML, manipulate its content.

    <info><product rid="prod_IE" minver="4.0"><platform rid="plat_win" minver="95"><platform rid="plat_nt" minver="4.0">


    soptest
    GeneralRe: HELP ME TO FIND AN ERROR Pin
    Alex Cramer18-Jul-02 15:26
    Alex Cramer18-Jul-02 15:26 
    GeneralRe: HELP ME TO FIND AN ERROR Pin
    Jörgen Sigvardsson21-Jul-02 8:21
    Jörgen Sigvardsson21-Jul-02 8:21 
    GeneralOdd bug causes my app to hang Pin
    MS le Roux16-Jul-02 23:46
    MS le Roux16-Jul-02 23:46 
    GeneralCustomDraw of a CListCtrl within a Composite Control. Pin
    Brian van der Beek16-Jul-02 22:56
    Brian van der Beek16-Jul-02 22:56 
    GeneralDeskband Pin
    Anonymous15-Jul-02 22:49
    Anonymous15-Jul-02 22:49 
    GeneralRe: Deskband Pin
    Shaun Harrington11-Oct-06 4:14
    Shaun Harrington11-Oct-06 4:14 
    Generalmsword automation Pin
    pnpfriend15-Jul-02 11:27
    pnpfriend15-Jul-02 11:27 
    GeneralPrinting from WebBrowser control Pin
    byblostas15-Jul-02 3:01
    byblostas15-Jul-02 3:01 
    GeneralUrgent!!!, Please, Application into a activex Pin
    powerrajesh14-Jul-02 22:45
    powerrajesh14-Jul-02 22:45 
    GeneralConnecting to IE Events Pin
    Alex Cramer14-Jul-02 16:05
    Alex Cramer14-Jul-02 16:05 
    GeneralRe: Connecting to IE Events Pin
    Anonymous15-Jul-02 13:16
    Anonymous15-Jul-02 13:16 
    GeneralRe: Connecting to IE Events Pin
    Alex Cramer15-Jul-02 17:30
    Alex Cramer15-Jul-02 17:30 
    GeneralCOM process killed and then reloaded Pin
    sefip13-Jul-02 23:36
    sefip13-Jul-02 23:36 
    GeneralCompositeControl 's background Pin
    Camel12-Jul-02 22:21
    Camel12-Jul-02 22:21 
    GeneralRe: CompositeControl 's background Pin
    Brian van der Beek16-Jul-02 21:04
    Brian van der Beek16-Jul-02 21:04 
    QuestionCRichEditCtrl in a COM object... possible? Pin
    jfugate12-Jul-02 4:39
    jfugate12-Jul-02 4:39 
    AnswerRe: CRichEditCtrl in a COM object... possible? Pin
    Ernest Laurentin12-Jul-02 5:48
    Ernest Laurentin12-Jul-02 5:48 

    General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

    Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.