ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • ATL
    ActiveX/컨트롤 2008. 12. 18. 19:05
    ActiveX 컨트롤 // OLE 컨트롤
    커스텀 컨트롤 COM 클래스

    a COM object that implements a certain set of interfaces that enable it to look and act like a control
    IDispatch
    expose methods and properties

    IConnectionPointContainer
    to fire events

    To find out what kinds of events the control is capable of firing (and by extension, what methods the container must implement in order to respond to control events), most containers read the control's type information.

    ActiveX control containers

    IOleControl
    액셀러레이터
    .GetControlInfo()
    OnMnemonic
    OnAmbientPropertyChange

    IOleControlSite
    액셀러레이터
    OnControlInfoChanged
    .GetExtendedControl()
    .TransformCoords()

    CComControlBase
    .FireViewChange()
    .SetDirty()
    .GetAmbientProperty()

    CWindowImpl -> CWindow

    CComControl
    -> CComControlBase
    -> CWindowImpl

    .CreateControlWindow()
    .GetAmbientBackColor() // OLE_COLOR
    .FireViewChange()
    컨트롤을 다시 그리게 한다.
    .FireOnRequestEdit()
    .FireOnChanged()

    OnDraw
    ATL_DRAWINFO
    .hdcDraw
    .prcBounds


    IErrorInfo
    .Error()

    IOleInPlaceActiveObject
    .TranslateAccelerator() // PreTranslateMessage

    ActiveX 컨트롤(OLE 컨트롤)
    in-proc COM server(DLL)

    An OCX can house one control or several controls.

    OLE 컨트롤 94 사양(OCX 94)
    replacement for custom control DLLs and Visual Basic controls (VBXs)
    The control has a window of its own, and the control is able to paint to that window and respond to user input.
    windowless controls

    Embedded Object로서의 ActiveX 컨트롤 // OLE
    자동화 개체로서의 ActiveX 컨트롤 // 자동화
    IOleControl
    IOleControlSite
    OLE 컨트롤 96 사양(OCX 96)
    to create interactive Web content

    custom and stock
    표준 속성(스톡 프로퍼티)
    .Appearance
    .Backcolor
    .BoderStyle
    .Caption
    .Enabled
    .Font
    .ForeColor
    .hWnd
    .ReadyState
    .Text
    표준 메소드(스톡 메소드)
    .Refresh()
    .DoClick()
    표준 이벤트(스톡 이벤트)
    .Click
    .DblClick
    .KeyDown
    .KeyPress
    .KeyUp
    .MouseDown
    .MouseMove
    .MouseUp
    .Error
    커스텀 속성
    커스텀 메소드
    커스텀 이벤트
    환경 속성(Ambient Property)
    .BackColor
    .DisplayName
    .Font
    .ForeColor
    .ScaleUnit
    .TextAlign
    확장 속성

    OnDraw
    .FireViewChange()
    스톡 프로퍼티(표준 속성?)
    Foreground Color
    Background Color
    Caption
    Font

    프로퍼티 페이지
        .Apply()    // virtual
        .SetDirty()

        .m_nObjects
        .m_ppUnk

    1. [ATL COM AppWizard] 프로젝트를 생성한다.
    DLL 컴포넌트 생성 // ??
    a host for COM objects

    2. [Insert|New ATL Object|Controls|Full Control( or Internet Explorer Control)] 항목을 선택해서 컨트롤 클래스를 생성한다..
    // ActiveX Control - COM object that have window
        [Names] 탭에서 'Short Name' 항목에 생성할 클래스 이름을 지정
        [Attributes] 탭에서 'Interface'(Dual or Custom), 'Aggregation', 'Support ISupportErrorInfo', 'Support Connection Points'등을 선택할 수 있다.
        [Miscellaneous] 탭에서 [Add control based on] 콤보 상자에서 원하는 표준 컨트롤을 선택할 수 있다.
    CContainedWindow
        [Stock Properties] 탭에서 스톡 프로퍼티를 추가한다.
    DISPID_FILLCOLOR

    3. 인터페이스의 컨텍스트 메뉴에서 커스텀 프로퍼티와 메소드를 추가한다.
    프로퍼티 맵

    4. 프로퍼티 페이지 추가
    [Insert | New ATL Object] 메뉴를 선택하고 [Controls | Property Page]를 추가
    프로퍼티 페이지 클래스의 OnInitDialog, Apply 가상함수를 수정하고 프로퍼티가 수정시 SetDirty 메소드 호출
    컨트롤 클래스의 프로퍼티 맵과 연결

    5. 이벤트 추가
    이벤트 인터페이스의 컨텍스트 메뉴에서 [Add Method]를 선택해서 메소드 추가
    구현 클래스의 컨텍스트 메뉴에서 [Implement Connection Point]를 선택해서 이벤트 클래스 생성
    기존 표준(?) 컨트롤을 서브클래싱하는 경우
    [Insert | New ATL Object] 메뉴를 선택하고 [Controls | Full Control]을 추가시 [Miscellaneous] 탭에서 [Add control based on]에서 클래스를 선택한다.
    합성 ActiveX 컨트롤
    [Insert | New ATL Object] 메뉴를 선택하고 [Controls | Composite Control]을 추가한다.
    인터넷 컨트롤(Lite Control)
    컨트롤의 안정성을 보장하지 않으면 Internet Explorer의 보안 설정을 낮음으로 설정하지 않으면 아예 동작을 하지 않는다.

    IObjectSafetyImpl<>
    스크립트 안전성

    다음은 스크립팅 안전성(CATID_SafeForScripting=7DD95801-9882-11CF-9FA9-00AA006C42C4) 뿐만 아니라 초기화 안전성(CATID_SafeForInitializing=7DD95802-9882-11CF-9FA9-00AA006C42C4)을 보장 // CObjectSafetyImpl
    ChangeWindowMessageFilter()


    http://support.microsoft.com/kb/165075
    http://longkee.egloos.com/1465094
    http://www.debuglab.com/knowledge/infdll.html
    http://www.microsoft.com/communities/newsgroups/list/en-us/default.aspx?dg=microsoft.public.kr.vc.qna&tid=0de86af0-23d1-4026-9604-99d6143bcad0&cat=&lang=&cr=&sloc=&p=1
    http://support.microsoft.com/kb/257717/en-us/
    http://www.debuglab.com/knowledge/activexfunc.html
    http://www.devpia.com/MAEUL/Contents/Detail.aspx?BoardID=51&MAEULNo=20&no=3912&ref=1305
    http://support.microsoft.com/kb/914257/ko
    http://www.devpia.com/MAEUL/Contents/Detail.aspx?BoardID=51&MAEULNo=20&no=6815&ref=6815
    http://darkkaiser.cafe24.com/blog/entry/ChangeWindowMessageFilter-Vista-%EC%97%90%EC%84%9C-%EB%A9%94%EC%8B%9C%EC%A7%80WM_COPYDATA%EB%93%B1-%EB%B3%B4%EB%82%B4%EA%B8%B0?TSSESSIONdarkkaisercafe24comblog=4b84c790181ae674415f6372202a582e
    http://support.microsoft.com/kb/196150/en-us/


Designed by Tistory.