CFileDialog AddIn | CodeGuru

CFileDialog AddIn

Click here for larger image Environment: Visual Studio 6 Description I really liked the idea of the CFileDialog macro posted here, but the interface was somewhat lacking versus the nice addin’s I’ve gotten in the past. So using this idea I created an addin for myself and thought I would share. I tried to use […]

Written By
CodeGuru Staff
CodeGuru Staff
Jun 14, 2001
1 minute read
CodeGuru content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More


Click here for larger image

Environment: Visual Studio 6

Description

I really liked the idea of the CFileDialog macro posted
here,
but the interface was somewhat lacking versus the nice addin’s I’ve gotten in
the past. So using this idea I created an addin for myself and thought I would
share. I tried to use the same type of interface as that of the MessageBox addin
that is so nice and posted
here. Enjoy!

Usage

Set all options you want then click “Copy to Clipboard” and paste into your .cpp file.

Example

Using the settings in the above image will output:

CFileDialog cFileDlg (
   TRUE,
   (LPCTSTR)NULL,
   _T("Initial Filename"),
   OFN_ENABLESIZING|OFN_ENABLEHOOK|OFN_EXPLORER|OFN_LONGNAMES|
           OFN_OVERWRITEPROMPT|OFN_CREATEPROMPT,
   _T("All Files (*.*)|*.*|"),
   this );
   cFileDlg.m_ofn.lpstrTitle = _T("Your Title Here!");
   // TODO: set the hook function
   //cFileDlg.m_ofn.lpfnHook = ;

Installing the Add-In

To install the add-in, follow these steps:

  1. Unzip the .dll file to the addin folder (default is \program files\microsoft visual studio\Common\MSDev98\AddIns)
  2. Go to Tools menu, Customize
  3. Go to the “Add-ins and Macro Files” tab
  4. Select the “CFileDialog AddIn” add-in and assign it to a hot key or put on a toolbar
Advertisement

Downloads

Download compiled dll – [18] Kb

Download source – [26] Kb

CodeGuru Logo

CodeGuru covers topics related to Microsoft-related software development, mobile development, database management, and web application programming. In addition to tutorials and how-tos that teach programmers how to code in Microsoft-related languages and frameworks like C# and .Net, we also publish articles on software development tools, the latest in developer news, and advice for project managers. Cloud services such as Microsoft Azure and database options including SQL Server and MSSQL are also frequently covered.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.