CRect::operator LPCRECT

转换 CRectLPCRECT

operator LPCRECT( ) const throw( );

备注

当您使用此功能,您不需要地址(&)运算符。 将自动使用此运算符,当您传递给需要 LPCRECT函数 CRect 对象。

示例

BOOL CMyDlg::OnInitDialog()
{
   CDialog::OnInitDialog();

   // CWnd::GetWindowRect() takes a LPRECT, but we can 
   // simply pass our CRect object because of the LPRECT 
   // cast operator in the CRect class.

   CRect rect;
   GetWindowRect(rect);

   // Similarly, CWnd::MoveWindow() takes a LPCRECT but 
   // the LPCRECT cast operator is used implicitly:

   MoveWindow(rect, FALSE);

   return TRUE;
}

要求

Header: atltypes.h

请参见

参考

CRect Class

层次结构图

CRect::operator LPRECT