Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6215847
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T07:07:49+00:00 2026-05-24T07:07:49+00:00

It would be nice if there is a way to customize the CFileDialog error

  • 0

It would be nice if there is a way to customize the CFileDialog error messages.

For example, Entering an invalid drive in the File name edit box causes an error message like below.

Invalid Drive

I want to show a different error here. Is it possible without subclassing CFileDialog?

It is also fine if the dialog returns instead of showing error.

Here is the code snippet:

CFileDialog dlgFile( TRUE, 0, 0,  OFN_HIDEREADONLY | OFN_ALLOWMULTISELECT, szFilters, 0, 0, 0 );
dlgFile.m_ofn.FlagsEx |= OFN_EX_NOPLACESBAR;
dlgFile.m_ofn.lpstrTitle= csTitle;
dlgFile.m_ofn.lpstrInitialDir = NULL;

const int nMaxFiles = 2512;
const int nBuffSize = ( ( nMaxFiles * ( MAX_PATH + 1 ) ) + 1 ) * sizeof( TCHAR );
dlgFile.GetOFN().lpstrFile = new TCHAR[ nBuffSize ];
::ZeroMemory( dlgFile.GetOFN().lpstrFile, nBuffSize );
dlgFile.GetOFN().nMaxFile = nBuffSize;
if( dlgFile.DoModal() == IDOK )
{
   ...
   ...
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T07:07:50+00:00Added an answer on May 24, 2026 at 7:07 am

    if it’s ok just to modify the dialog, you can install a hook SetWindowsHookEx with WH_CBT.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

do you have idea, if there would be some nice way to browse/log JMS
Is there a way to use IntelliJ when pair-programming? It would be nice to
Maybe a dumb question, but it would be nice if there was a way
Is there a nice way to do this in Objective-C, or do I have
Is there any way to detect if computer has speakers plugged in? It would
Is there any way possible short of hand-coding the Reference.cs file, to get Visual
Is there a way to hook into the internals of CompositionContainer? For example, let's
Is there any way to easily use a remote javascript file as a content
Yesterday I thought it would be nice to implement my own Trigger in a
I have a C extension module and it would be nice to distribute built

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.