这个跟AfxGetApp()的实现有关。你可以参考MFC的源代码,它就是把theApp的地址返回给你呀。所以其中pApp指向theApp全局变量,说的没错呀.

解决方案 »

  1.   

    AfxGetApp  
    CWinApp* AfxGetApp( ); Return ValueA pointer to the single CWinApp object for the application.ResThe pointer returned by this function can be used to access application information such as the main message-dispatch code or the topmost window.
    theApp是一个全局变量,用来指向程序本身,而函数AfxGetApp( )的作用也是得到指向应用程序的指针,所以他们两个实际上是相同的。
      

  2.   

    m_pCurrentWinApp  =  this;
      

  3.   

    CWinApp* pApp = AfxGetApp();
    其中AfxGetApp()的定义为:
    CWinApp* AfxGetApp()
    {
    return theApp.m_pCurrentWinApp;
    }
    m_pCurrentWinApp  =  this;
    注意这个this指针,它是指向全局对象theApp的
    所以pApp当然是指向全局对象theApp的至于你说“它应该指向的是这个全局变量中间的一个数据段吧”不知是啥意思?