ActiveX


.


, : Mytrl.h b Mytrl.cpp.

MyCtrl.h , ActiveX ( ):

class CMyCtrl : public CWnd

{

protected:

DECLARE_DYNCREATE(CMyCtrl)

public:

CLSID const& GetClsid()

{

static CLSID const clsid

= { 0x49e2f37f, 0xb48d, 0x11d3, { 0xa2, 0xb0, 0x0, 0xa0, 0xc9, 0x55, 0xfa, 0x9e } };

return clsid;

}

virtual BOOL Create(LPCTSTR lpszClassName,

LPCTSTR lpszWindowName, DWORD dwStyle,

const RECT& rect,

CWnd* pParentWnd, UINT nID,

CCreateContext* pContext = NULL)

{ return CreateControl(GetClsid(), lpszWindowName, dwStyle, rect, pParentWnd, nID); }

 

BOOL Create(LPCTSTR lpszWindowName, DWORD dwStyle,

const RECT& rect, CWnd* pParentWnd, UINT nID,

CFile* pPersist = NULL, BOOL bStorage = FALSE,

BSTR bstrLicKey = NULL)

{ return CreateControl(GetClsid(), lpszWindowName, dwStyle, rect, pParentWnd, nID,

pPersist, bStorage, bstrLicKey); }

 

// Attributes

public:

short GetShape();

void SetShape(short);

short Get_Shape();

void Set_Shape(short);

BOOL GetSelected();

void SetSelected(BOOL);

OLE_COLOR GetForeColor();

void SetForeColor(OLE_COLOR);

unsigned long GetSelectColor();

void SetSelectColor(unsigned long);

CString GetCaption();

void SetCaption(LPCTSTR);

COleFont GetFont();

void SetFont(LPDISPATCH);

unsigned long GetTextColor();

void SetTextColor(unsigned long);

 

// Operations

public:

void AboutBox();

};

, . 4 . IDC_SHAPE , . IDC_NEWTEXT , ActiveX. IDC_TEXT ActiveX.




- -  - -  - -