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 類別

階層架構圖

CRect::operator LPRECT