CRect::operator LPCRECT See Also CRect Overview | Class Members | Hierarchy Chart | CRect::operator LPRECTConverts a CRect to an LPCRECT. operator LPCRECT( ) const throw( ); Res When you use this function, you don't need the address-of (&) operator. This operator will be automatically used when you pass a CRect object to a function that expects an LPCRECT. Example void CYourView::OnInitialUpdate() { // 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); // ... more code here ... }
直接转换。实际上CRect是从_tagRECT这个结构继承来的。
CRect::operator LPRECT Converts a CRect to an LPRECT.operator LPRECT( ) throw( ); Res When you use this function, you don't need the address-of (&) operator. This operator will be automatically used when you pass a CRect object to a function that expects an LPRECT.CRect rect LPRECT p; p = LPRECT(rect);
CRect Overview | Class Members | Hierarchy Chart | CRect::operator LPRECTConverts a CRect to an LPCRECT.
operator LPCRECT( ) const throw( );
Res
When you use this function, you don't need the address-of (&) operator. This operator will be automatically used when you pass a CRect object to a function that expects an LPCRECT.
Example
void CYourView::OnInitialUpdate()
{
// 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); // ... more code here ...
}
Converts a CRect to an LPRECT.operator LPRECT( ) throw( );
Res
When you use this function, you don't need the address-of (&) operator. This operator will be automatically used when you pass a CRect object to a function that expects an LPRECT.CRect rect
LPRECT p;
p = LPRECT(rect);
GetWindowRect(rect);LPRECT lpRect;
lpRect = (LPRECT)rect; MoveWindow(lpRect);