A simple example is provided to illustrate the design concept.
Interface:
Iplatform: iunknown
Iview: iplatform
Ipicview: iview
---------------------------------
Icontorl: iplatform
Itoolbarctl: icontorl
========================================================
Implementation:
//////////////////////////////////////// /////////////////////////////////////
// Iplatformimpl
Template <class T>
Class atl_no_vtable iplatformimpl:
Public t
{
Public:
XXXX // iplatform Method
}
//////////////////////////////////////// /////////////////////////////////////
// Iviewimpl
Template <class T, Class I>
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 <csf-wimpl <cpicview>, iplatformimpl <ipicview>,
Public ccomobjectroot,
Public ccomcoclass <cpicview>,