COleFont类 就这么几个成员函数:class COleFont : public COleDispatchDriver { public: COleFont() {} // Calls COleDispatchDriver default constructor COleFont(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {} COleFont(const COleFont& dispatchSrc) : COleDispatchDriver(dispatchSrc) {}// Attributes public: CString GetName(); void SetName(LPCTSTR); CY GetSize(); void SetSize(const CY&); BOOL GetBold(); void SetBold(BOOL); BOOL GetItalic(); void SetItalic(BOOL); BOOL GetUnderline(); void SetUnderline(BOOL); BOOL GetStrikethrough(); void SetStrikethrough(BOOL); short GetWeight(); void SetWeight(short); short GetCharset(); void SetCharset(short);// Operations public: }; 它的函数都很简单,例如://Setup Local Variables in your code COleFont MyFont; CY FontSize;//Get a copy of the font from the component MyFont = m_chart.GetFont();//Set the Font Size FontSize.int64 = 240000; //Point Size 24 (24 * 10000 = 240000) MyFont.SetSize(FontSize);//Set the Font Name MyFont.SetName("Times New Roman"); //"Arial"等等//Set Various Font Styles MyFont.SetBold(TRUE); MyFont.SetItalic(FALSE); MyFont.SetUnderline(FALSE); MyFont.SetStrikethrough(FALSE);//Set the font back on the component m_chart.SetFont(MyFont);
{
public:
COleFont() {} // Calls COleDispatchDriver default constructor
COleFont(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {}
COleFont(const COleFont& dispatchSrc) : COleDispatchDriver(dispatchSrc) {}// Attributes
public:
CString GetName();
void SetName(LPCTSTR);
CY GetSize();
void SetSize(const CY&);
BOOL GetBold();
void SetBold(BOOL);
BOOL GetItalic();
void SetItalic(BOOL);
BOOL GetUnderline();
void SetUnderline(BOOL);
BOOL GetStrikethrough();
void SetStrikethrough(BOOL);
short GetWeight();
void SetWeight(short);
short GetCharset();
void SetCharset(short);// Operations
public:
};
它的函数都很简单,例如://Setup Local Variables in your code
COleFont MyFont;
CY FontSize;//Get a copy of the font from the component
MyFont = m_chart.GetFont();//Set the Font Size
FontSize.int64 = 240000; //Point Size 24 (24 * 10000 = 240000)
MyFont.SetSize(FontSize);//Set the Font Name
MyFont.SetName("Times New Roman"); //"Arial"等等//Set Various Font Styles
MyFont.SetBold(TRUE);
MyFont.SetItalic(FALSE);
MyFont.SetUnderline(FALSE);
MyFont.SetStrikethrough(FALSE);//Set the font back on the component
m_chart.SetFont(MyFont);