
Your application should contain a server item class derived from COleServerItem. It is important to override OnGetExtent(), OnDraw(), and Serialize(). The declaration of your COleServerItem derived class should look like Example 21.
class CMyAppSrvrItem : public COleServerItem
{
VIEWS_DECLARE_DYNAMIC(CMyAppSrvrItem)
// Constructors
public:
CMyAppSrvrItem(CMyAppDoc* pContainerDoc);
// Attributes
CMyAppDoc* GetDocument() const
{ return (CMyAppDoc*)COleServerItem::GetDocument(); }
CMyAppViewport* GetViewport();
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMyAppSrvrItem)
public:
virtual BOOL OnDraw(CDC* pDC, CSize& rSize);
virtual BOOL OnGetExtent(DVASPECT dwDrawAspect, CSize& rSize);
//}}AFX_VIRTUAL
// Implementation
public:
~CMyAppSrvrItem();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
virtual void Serialize(CArchive& ar); // overridden for document i/o
}
|
Copyright © Rogue Wave Software, Inc. All Rights Reserved.
The Rogue Wave name and logo, and Stingray, are registered trademarks of Rogue Wave Software. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.