这个函数的参数不是对话框的ID,而是对话框中控件的ID,此函数返回值为指向所指定控件的指针。

解决方案 »

  1.   

    请注意,这个函数有两个,一个是API函数,另一个是CWnd类的成员函数。详细的资料,你可以参考MSDN。
      

  2.   

    GetDlgItem是用来获取控件的
      

  3.   

    用这个函数之前, 最好判断一下 控件是否有安全橘饼 GetSafeHwnd();
      

  4.   

    GetSafeHwnd();
    用这个函数怎么判断?
      

  5.   

    GetSafeHwnd();
    ==========
    需要吗?CWnd* GetDlgItem ( 
    int nID ) 
    const; Return Value
    Returns a pointer to the given control or child window. If no control with the integer ID given by the nID parameter exists, the value is NULL.