Programming

IWebBrowser2::Document

bcheul 2007. 4. 27. 16:24

관련 MSDN 링크 :

Web Development

   -> Programing and Reusing the Browser

       -> WebBrowser Control

           -> Reference for C/C++ Development

               -> Interface

                   -> IWebBrowser2



IWebBrowser2::Document Property


Retrieves the automation object of the active document, if any.

 -> 활성화된 document의 automation 객체를 반환한다. ( if any 는 뭔소리래 -_-? )


Syntax ( 형식 or 문법 )

     HRESULT IWebBrowser2::get_Document ( IDispatch **ppDisp )


Parameters

   ppDisp :

     Address of a variable of type IDispatch interface that receives the automation object.

     -> IDispatch 타입의 반환한 automation 객체의 값에 대한 포인터의 주소.


Return Value

    returns one of the following values.

      S_OK                  : The operation was successful.  -> 실행한 명령이 성공했을 경우 반환

      E_FAIL                : The operation failed.  -> 실행한 명령이 실패 했을 경우 반환.

      E_INVALIDARG     : One or more parameters are invalid. -> 실행시 인수값이 잘못된 경우

      E_NOINTERFACE : The interface is not supported. -> 인터페이스(?)가 지원 안됌?


Remark

   When the active document is an HTML page, this property provides access to the contents of the HTML Document Object Model (DOM).

   Specifically, it returns an IDispatch interface pointer to the HTMLDocument component object class (coclass).

   The HTMLDocument coclass is functionally equivalent to the Dynamic HTML (DHTML) document object used in HTML script.

   It supports all the properties and methods necessary to access the entire contents of the active HTML document.

 -> 활성화된 document가 HTML 형식의 페이지 일경우, 이 프로퍼티는 DOM 객체를 통해서 페이지에 접근을 준비한다.(?)

    명확히 말해, IDispatch 형식 인터페이스의 포인터를 HTMLDocument 콤포넌트 클래스에 리턴한다. (coclass).

   HTMLDocument 콤포넌트 클래스는 HTML 스크립트상에서의 HTML의 document 객체와 같은 기능을 한다.

   이 객체는 활성화된 HTML document의 내용(contents)에 접근하기 위한 모든 프로퍼티와 메소드를 지원한다.


----------------------------------------------------------------------------------------

아마 실제 사용은...

RValue = iWeb.get_Document ( ppDisp );

와 같은 형식으로 ppDisp 변수에 IDispatch 인터페이스의 형태로 웹문서를 읽어 들인후

HTMLDocument 형태의 클래스에서 다시 이 IDispatch 인터페이스로 된 웹문서를 읽어 들인 후,

조작이 가능하다.

'Programming' 카테고리의 다른 글

순서도  (0) 2007.05.21
USB 드라이버 관련자료  (0) 2007.04.27
IWebBrowser2 Interface  (0) 2007.04.27
Vista 에서 버전별 Visual Studio 소개 및 사용  (0) 2007.02.28
다이알로그에 상태표시줄 달기~  (2) 2006.12.21