CRect rect;
GetClientRect(rect)和GetClientRect(&rect)两个函数好像编译都能通过,两者是一样的么?

解决方案 »

  1.   

    应该还是用GetClientRect(&rect)吧
      

  2.   

    CWnd::GetClientRect
    This method copies the client coordinates of the CWnd client area into the structure pointed to by lpRect. The client coordinates specify the upper-left and lower-right corners of the client area. Since client coordinates are relative to the upper-left corners of the CWnd client area, the coordinates of the upper-left corner are (0,0).void GetClientRect( 
    LPRECT lpRect ) 
    const; 参数应该为&rect,也即是指针,你可以看看两种不同调用方法分别取得的结果。
      

  3.   

    楼上说的是,看看CRect函数就知道了,它重载了好几种方法!