在vc++.net中,将 m_FileDlg.m_pOFN->lStructSize=88; 显示还是win98的打开文件对话框,
而不是win2000打开对话框. 源码如下:
CFileDialog m_FileDlg(true);
   m_FileDlg.m_pOFN->lStructSize=88; 
if(m_FileDlg.DoModal()==IDOK){
CString strDir;
strDir=m_FileDlg.GetFileName();
}m_FileDlg.m_pOFN->lStructSize原值为76

解决方案 »

  1.   

    OPENFILENAME ofn;
         ZeroMemory(&ofn,sizeof(OPENFILENAME));
         ofn.lStructSize =sizeof(OPENFILENAME);
        ofn.lpstrFilter="*.*";
        ofn.nMaxFile=700;
       
        ofn.hwndOwner =m_hWnd;
        GetOpenFileName(&ofn);
      

  2.   

    In order to access Win2000 specific APIs etc, one needs the following #define in the application's stdafx.h (before any other #includes) 
    #define _WIN32_WINNT 0x0500