Share via


CRect::operator LPCRECT

Converte CRect a LPCRECT.

operator LPCRECT( ) const throw( );

Note

Quando si utilizza questa funzione, non è necessario disporre dell'operatore (&).Questo operatore automaticamente verrà utilizzato quando si passa un oggetto CRect a una funzione che prevede LPCRECT.

Esempio

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;
}

Requisiti

Header: atltypes.h

Vedere anche

Riferimenti

Classe di CRect

Grafico della gerarchia

CRect::operator LPRECT