BOOL CMyTestApp::InitInstance()
{
CHAR CurrentWinTitle[MAX_PATH];
CWnd *pCurrentWindow = NULL;
HWND hCurrentWindow = NULL; pCurrentWindow=AfxGetMainWnd();
hCurrentWindow=pCurrentWindow->GetSafeHwnd();
::GetWindowText(hCurrentWindow,CurrentWinTitle,MAX_PATH);
AfxMessageBox(CurrentWinTitle);        ......
}请问这段代码执行后为什么取不到主窗口的指针啊,总是返回0x000000有什么需要注意的吗?谢谢!