CDC类中的成员函数Ellips有两种形式:
Ellipse(int x1, int x2, int y1, int y2);
Ellipse(LPCRECT *lpRect);
当我使用第二种形式时, 为什么以下两种都没有问题:
Ellipse(&CRect(0, 20, 100, 120));  // As it indicates, this formal is right, as the member function needs a      
                                   // pointer to CRectEllipse(CRect(0, 20, 100, 120));  // it work ,too! (on VS2008)Why?Thanks.

解决方案 »

  1.   

    Converts a CRect to an LPCRECT.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.
      

  2.   


    for more please browse to msdn
      

  3.   


    However, I really want to know why it's designed by that. The "automatical translation" is  implicit.
    I mean, ths translation should be forbidden.Thanks all the same.
      

  4.   

    the msdn tell us what but not why. 
    I really want to know why it's designed by that. The "automatical translation" is implicit.
    I mean, ths translation should be forbidden.Thanks all the same.
      

  5.   

    the msdn tell us what but not why.  
    I really want to know why it's designed by that. The "automatical translation" is implicit.
    I mean, ths translation should be forbidden.
    Thanks all the same.