Implement interface design with ATL techniques

zhaozj2021-02-16  64

Give a simple example, reflect the design ideas

interface:

IPLATFORM: IUNKNOWN

IView: iplatform

IpicView: IVIEW

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

Icontorl: iplatform

Itoolbarctl: icontorl

========================================

achieve:

/// iplatformimpltemplate Class ATL_NO_VTABLE IPLATFORMPL: PUBLIC T {PUBLIC:

XXXX // iplatform method

}

/// iViewImpltemplate Class ATL_NO_VTABLE IVIEWIMPL: Public T, Public I

{Begin_MSG_MAP (IViewImpl) Message_Handler (WM_ERASEBKGND, OneRaseBkgnd) End_MSG_MAP () PUBLIC: DECLARE_WND_CLASS ("Platform_View") YYYY // IVIEW method

}

//

Class Cpicview: Public IVIEWIMPL , iplatformimpl >>, public ccomobjectroot, Public CCOMCOCLASS ,

转载请注明原文地址:https://www.9cbs.com/read-17177.html

New Post(0)