错误代码如下CDrawText::CDrawText()
{
srand(GetTickCount());
m_Color=RGB(rand()%0xFF,rand()%0xFf,rand()%0xFF);
m_str="未定义";
memset(&m_Font,0,sizeof(m_Font));
m_Font.IfHeight=16; //这里为错误代码
m_Font.IfWidth=8;
m_Font.IfWeight=FW_NORMAL;
错误提示如下
C:\samples\S14_DLL\DrawText.cpp(26) : error C2039: 'IfHeight' : is not a member of 'tagLOGFONTA'
c:\program files\microsoft visual studio\vc98\include\wingdi.h(1073) : see declaration of 'tagLOGFONTA'
但是在wingdi.h 明明有代码如下
#define LF_FACESIZE 32
typedef struct tagLOGFONTA
{
LONG lfHeight;
LONG lfWidth;
LONG lfEscapement;
LONG lfOrientation;
LONG lfWeight;
BYTE lfItalic;
BYTE lfUnderline;
BYTE lfStrikeOut;
BYTE lfCharSet;
BYTE lfOutPrecision;
BYTE lfClipPrecision;
BYTE lfQuality;
BYTE lfPitchAndFamily;
CHAR lfFaceName[LF_FACESIZE];
} LOGFONTA, *PLOGFONTA, NEAR *NPLOGFONTA, FAR *LPLOGFONTA;
{
srand(GetTickCount());
m_Color=RGB(rand()%0xFF,rand()%0xFf,rand()%0xFF);
m_str="未定义";
memset(&m_Font,0,sizeof(m_Font));
m_Font.IfHeight=16; //这里为错误代码
m_Font.IfWidth=8;
m_Font.IfWeight=FW_NORMAL;
错误提示如下
C:\samples\S14_DLL\DrawText.cpp(26) : error C2039: 'IfHeight' : is not a member of 'tagLOGFONTA'
c:\program files\microsoft visual studio\vc98\include\wingdi.h(1073) : see declaration of 'tagLOGFONTA'
但是在wingdi.h 明明有代码如下
#define LF_FACESIZE 32
typedef struct tagLOGFONTA
{
LONG lfHeight;
LONG lfWidth;
LONG lfEscapement;
LONG lfOrientation;
LONG lfWeight;
BYTE lfItalic;
BYTE lfUnderline;
BYTE lfStrikeOut;
BYTE lfCharSet;
BYTE lfOutPrecision;
BYTE lfClipPrecision;
BYTE lfQuality;
BYTE lfPitchAndFamily;
CHAR lfFaceName[LF_FACESIZE];
} LOGFONTA, *PLOGFONTA, NEAR *NPLOGFONTA, FAR *LPLOGFONTA;
是m_Font.lfHeight=16; //这里为错误代码
m_Font.lfWidth=8;
m_Font.lfWeight=FW_NORMAL;
小写的L