error C2664: 'GetClientRect' : cannot convert parameter 一 from 'struct CvRect
error C2664: 'GetClientRect' : cannot convert parameter 1 from 'struct CvRect *
CvRect rect;
CFrameWnd *pFrame=(CFrameWnd*)AfxGetMainWnd();
pFrame->GetActiveView()->GetClientRect(&rect);
请问这个怎么转换啊
------解决方案--------------------

在MFC中,该函数的原型为void GetClientRect(LPRECT lpRect) const;
typedef struct CvRect
{
int x; /* 方形的左上角的x-坐标 */
int y; /* 方形的左上角的y-坐标*/
int width; /* 宽 */
int height; /* 高 */
}
typedef struct tagRECT
{
LONG left;
LONG top;
LONG right;
LONG bottom;
} RECT, *PRECT, NEAR *NPRECT, FAR *LPRECT;
这2个结构是一样的,但是GetClientRect的参数是LPRECT,所以你
pFrame->GetActiveView()->GetClientRect((LPRECT)&rect);
CvRect rect;
CFrameWnd *pFrame=(CFrameWnd*)AfxGetMainWnd();
pFrame->GetActiveView()->GetClientRect(&rect);
请问这个怎么转换啊
------解决方案--------------------
在MFC中,该函数的原型为void GetClientRect(LPRECT lpRect) const;
typedef struct CvRect
{
int x; /* 方形的左上角的x-坐标 */
int y; /* 方形的左上角的y-坐标*/
int width; /* 宽 */
int height; /* 高 */
}
typedef struct tagRECT
{
LONG left;
LONG top;
LONG right;
LONG bottom;
} RECT, *PRECT, NEAR *NPRECT, FAR *LPRECT;
这2个结构是一样的,但是GetClientRect的参数是LPRECT,所以你
pFrame->GetActiveView()->GetClientRect((LPRECT)&rect);