CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2004
    Posts
    43

    the CFileDialog in a dialog's OnCommand() cause the program crash

    I want to use a CFileDialog in my dialog's OnCommand() function
    like this:

    int nCommandId = wParam & 0x0000FFFF;
    switch(nCommandId)
    {
    case ID_BUTTON:
    {
    CFileDialog dlg(true,NULL,"*.ico",OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT, _T("*.ico"));


    if(dlg.DoModal()==IDOK)
    {
    //doing something
    }
    }
    }
    return CDialog::OnCommand(wParam, lParam);

    but when i open a file and then close my dialog,the whole programe crashs ,why ?

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396
    1. It is not clear what "the whole programe crashs " means
    2. take a look at this thread

  3. #3
    Join Date
    Mar 2004
    Posts
    43
    VictorN
    thank you ,I've soved this problem,it's seems that the CFileDialog
    change the current path

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured