怎样利用字符串表设置同时打开两种不同扩展名的文件?

解决方案 »

  1.   

    OPENFILENAME ofn;       // common dialog box structure
    char szFile[2048];       // buffer for file name
    szFile[0]=0;
    // Initialize OPENFILENAME
    ZeroMemory(&ofn, sizeof(OPENFILENAME));
    ofn.lStructSize = sizeof(OPENFILENAME);
    ofn.hwndOwner = NULL;
    ofn.lpstrFile = szFile;
    ofn.nMaxFile = sizeof(szFile);
    ofn.lpstrFilter = "JPG/BMP\0*.jpg;*.bmp\0";//"All\0*.*\0Text\0*.TXT\0";
    ofn.nFilterIndex = 1;
    ofn.lpstrFileTitle = NULL;
    ofn.lpstrTitle = "Select image files to import";
    ofn.nMaxFileTitle = 0;
    ofn.lpstrInitialDir = NULL;//"c:\\";
    ofn.Flags = /*OFN_PATHMUSTEXIST |*/ OFN_FILEMUSTEXIST| OFN_ALLOWMULTISELECT|OFN_EXPLORER; // Display the Open dialog box. 
    if(GetOpenFileName(&ofn))
      

  2.   

    这个我知道,我想知道在MFC中怎样通过IDRMAINTYPE设置来达到目的?