如何使用CDialog类的成员函数 打开当前目录!!
TCHAR path[128];
GetModuleFileNmae(NULL,path,128);
CDialog dialog;下面应该调用CDialog的哪个成员函数?
我这没有MSDN~

解决方案 »

  1.   

    dialog.setwindowtext(path);//显示在窗口的标题栏里
    dialog.domodal();
      

  2.   

    whs1980(知秋一叶) 
    语句出错啦~假如我要打开.BMP的文件~怎么办?
      

  3.   

    ShellExecute(NULL, "open",path, NULL, NULL, NULL) //用该函数打开
      

  4.   

    OPENFILENAME ofn;       // common dialog box structure
        char szFile[260];       // buffer for file name
        
         // Initialize OPENFILENAME
         ZeroMemory(&ofn, sizeof(ofn));
         ofn.lStructSize = sizeof(ofn);
         ofn.hwndOwner = m_hWnd;
         ofn.lpstrFile = szFile;
         //
         // Set lpstrFile[0] to '\0' so that GetOpenFileName does not 
         // use the contents of szFile to initialize itself.
         //
         ofn.lpstrFile[0] = '\0';
         ofn.nMaxFile = sizeof(szFile);
         ofn.lpstrFilter = "Bitmap\0*.bmp\0";//只打开bmp
         ofn.nFilterIndex = 1;
         ofn.lpstrFileTitle = NULL;
         ofn.nMaxFileTitle = 0;
         ofn.lpstrInitialDir = NULL;
         ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST;     // Display the Open dialog box.      if (GetOpenFileName(&ofn)==TRUE) 
     {
                 ....................  }
     else
     {
                ...................
     }
      

  5.   

    chenbuaa(萧儿) 
    你的方法是对的~!!
    可是我用的是MFC~不想用SDK的API啊!!!!
      

  6.   

    CFileDialog dialog(TRUE,path,NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
                        "ALll File (*.*)|*.*||",NULL);
     dialog.DoModal();