一个VC++字体通用的类

#include "stdafx.h"
#include "font.h"


/////////////////////////////////////////////////////////////////////////////
// COleFont properties

CString COleFont::GetName()
{
 CString result;
 GetProperty(0x0, VT_BSTR, (void*)&result);
 return result;
}

void COleFont::SetName(LPCTSTR propVal)
{
 SetProperty(0x0, VT_BSTR, propVal);
}

CY COleFont::GetSize()
{
 CY result;
 GetProperty(0x2, VT_CY, (void*)&result);
 return result;
}

void COleFont::SetSize(const CY& propVal)
{
 SetProperty(0x2, VT_CY, &propVal);
}

BOOL COleFont::GetBold()
{
 BOOL result;
 GetProperty(0x3, VT_BOOL, (void*)&result);
 return result;
}

void COleFont::SetBold(BOOL propVal)
{
 SetProperty(0x3, VT_BOOL, propVal);
}

BOOL COleFont::GetItalic()
{
 BOOL result;
 GetProperty(0x4, VT_BOOL, (void*)&result);
 return result;
}

void COleFont::SetItalic(BOOL propVal)
{
 SetProperty(0x4, VT_BOOL, propVal);
}

BOOL COleFont::GetUnderline()
{
 BOOL result;
 GetProperty(0x5, VT_BOOL, (void*)&result);
 return result;
}

void COleFont::SetUnderline(BOOL propVal)
{
 SetProperty(0x5, VT_BOOL, propVal);
}

BOOL COleFont::GetStrikethrough()
{
 BOOL result;
 GetProperty(0x6, VT_BOOL, (void*)&result);
 return result;
}

void COleFont::SetStrikethrough(BOOL propVal)
{
 SetProperty(0x6, VT_BOOL, propVal);
}

short COleFont::GetWeight()
{
 short result;
 GetProperty(0x7, VT_I2, (void*)&result);
 return result;
}

void COleFont::SetWeight(short propVal)
{
 SetProperty(0x7, VT_I2, propVal);
}

short COleFont::GetCharset()
{
 short result;
 GetProperty(0x8, VT_I2, (void*)&result);
 return result;
}

void COleFont::SetCharset(short propVal)
{
 SetProperty(0x8, VT_I2, propVal);
}

转载于:https://www.cnblogs.com/carekee/articles/1747588.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值