Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. CFileDialog problem under win 98

CFileDialog problem under win 98

Scheduled Pinned Locked Moved C / C++ / MFC
help
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    lbc
    wrote on last edited by
    #1

    Hello all I have a VC7 dialog based application. Basically one dialog with an edit box IDC_EDIT and 2 buttons IDC_READ_MYFILE IDC_CANCEL when I press the IDC_READ_MYFILE button i want to open a standard File Open Dialog, managed by the message_map entry, something like this: ON_BN_CLICKED(IDC_READ_MYFILE, OnReadMyfile) ... void CMyAppDlg::OnReadMyfile() { // TODO: Add your control notification handler code here static CString szFilter = "DXF Files (*.dxf)|*.dxf||"; CFileDialog fileDialog(TRUE, "dxf", NULL, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, szFilter, NULL ); if(fileDialog.DoModal() == IDOK) { CString sDXF_FileName; sDXF_FileName = fileDialog.GetPathName(); ... do some processing on this file UpdateData(FALSE); } } Tested under windows XP it *works fine* (opening the File Dialog and processing the selected file as needed) but under windows 98 it works but when pressing on the IDC_READ_MYFILE button nothing happens (the File Open dialog is not open) while the close button works and also the about message box works (called inside the dialog top left System menu) By the way I have checked the resources IDs and there isn't any conflict any help/tips will be greatly appreciated thanks in advance! best regards

    L 1 Reply Last reply
    0
    • L lbc

      Hello all I have a VC7 dialog based application. Basically one dialog with an edit box IDC_EDIT and 2 buttons IDC_READ_MYFILE IDC_CANCEL when I press the IDC_READ_MYFILE button i want to open a standard File Open Dialog, managed by the message_map entry, something like this: ON_BN_CLICKED(IDC_READ_MYFILE, OnReadMyfile) ... void CMyAppDlg::OnReadMyfile() { // TODO: Add your control notification handler code here static CString szFilter = "DXF Files (*.dxf)|*.dxf||"; CFileDialog fileDialog(TRUE, "dxf", NULL, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, szFilter, NULL ); if(fileDialog.DoModal() == IDOK) { CString sDXF_FileName; sDXF_FileName = fileDialog.GetPathName(); ... do some processing on this file UpdateData(FALSE); } } Tested under windows XP it *works fine* (opening the File Dialog and processing the selected file as needed) but under windows 98 it works but when pressing on the IDC_READ_MYFILE button nothing happens (the File Open dialog is not open) while the close button works and also the about message box works (called inside the dialog top left System menu) By the way I have checked the resources IDs and there isn't any conflict any help/tips will be greatly appreciated thanks in advance! best regards

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      This is an MFC7 bug I'm afraid. There is an MSDN article on this I think (you'll get the same problem on Win95 and older versions of NT4). The fix is to pass zero as the last param, e.g.: CFileDialog fileDialog(TRUE, "dxf", NULL, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, szFilter, NULL, 0);


      When I am king, you will be first against the wall.

      L 1 Reply Last reply
      0
      • L Lost User

        This is an MFC7 bug I'm afraid. There is an MSDN article on this I think (you'll get the same problem on Win95 and older versions of NT4). The fix is to pass zero as the last param, e.g.: CFileDialog fileDialog(TRUE, "dxf", NULL, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, szFilter, NULL, 0);


        When I am king, you will be first against the wall.

        L Offline
        L Offline
        lbc
        wrote on last edited by
        #3

        thank you very much! i was getting crazy finding out which reasons could be causing that strange behaviour best regards

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups