ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • Out of Process, MFC
    ActiveX/Automation 2008. 11. 28. 00:08
    1. AppWizard로 SDI 프로젝트를 생성한다. 이 때 스텝3에서 [Automation]을 체크한다.

    2. ClassView에서 인터페이스를 선택해서 팝업메뉴에서 [Add Method]/[Add Property]를 사용해서 메소드와 프라퍼티를 추가한다.
    /*
    or

    ClassWizard's Automation page
    Add Method button
    Add Property button
    */
    modifications to the project's source code files:
    The method and its dispatch ID are added to the project's ODL file.
    The function that implements the method is declared in the class's header file.
    An empty function implementation is added to the class's CPP file.
    A DISP_FUNCTION statement is added to the class's dispatch map.

    two types of Automation properties
    Member variable properties
    DISP_PROPERTY()
    DISP_PROPERTY_NOTIFY()
    Get/set properties
    DISP_PROPERTY_EX()
    DISP_PROPERTY_PARAM()
    indexed properties

    to fire events
    An event is a notification sent from a control to its container.
    Windows controls send notifications to their owners by sending messages
    ActiveX controls send notifications to their containers by firing events.

    An MFC Automation server registers itself each time it's run.

    새로운 자동화 개체 추가
    [Insert | New Class]를 선택해서 [Base Class]는 CCmdTarget, [Automation] 항목을 체크해서 MFC 클래스 추가 - 생성자와 소멸자를 public으로 수정

    생성된 클래스의 멤버를 추가하고 인터페이스를 연결한다.

    원래 인터페이스에 LPDISPATCH 타입과 Get/Set mothod로 프로퍼티 추가
    하나의 서버 운용

Designed by Tistory.