BOOL App::OnInitDialog(
    HWND hWndDialog,
    WPARAM /*wParam*/,
    LPARAM /*lParam*/
    )
{
    // Initialize controls
    m_hWnd = hWndDialog;
    ::SetWindowLong(m_hWnd, GWL_USERDATA, (LONG) this);    return TRUE;
}xiexie

解决方案 »

  1.   

    类App创建的对象的基址指针,简言之:当前对象的指针
      

  2.   

    每个类都有自己的对象,叫this
      

  3.   

    Each member funtion has an extra,implicit parameter named this.When a member funtion is called, the this parameter is initialized with the address of the object on which the funtion was invoked.
      

  4.   

    I forgot that static member functions have no this pointer
      

  5.   

    this就是一个指针,指向当前类的实例,每个被调用成员之前都有this指针,只不过VC帮你省略了而已,不然程序不知道你在调用哪个实例的成员
    比如
    m_hWnd = hWndDialog; 
    其实就是
    this->m_hWnd = hWndDialog;
      

  6.   

    指向APP
    每个类对象都有一个隐藏指针
      

  7.   

    搂主这样的情况,指向的是你对话框项目的对话框类,即后缀名挂Dlg的那个初始类。
      

  8.   

    SetWindowLong(m_hWnd,   GWL_USERDATA,   (LONG)this);
    这里用this的目的是把该对象地址保存到窗口结构的用户自定义数据成员里;
      

  9.   

    指的当前的类对象,static函数中没有。
      

  10.   

    引用: BOOL App::OnInitDialog( this就是这个App类对象的指针,this指向App本身