[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

Question on Common Dialog

Posted on 2000-01-28
1
Medium Priority
?
285 Views
Last Modified: 2010-04-02
In a common dialog box (Open / Save As) that is invoked by an application, I want to find out the filename string that the user has typed in the edit box as well as the default extension string that would be appended to the filename. The problem is that I can not use a hook to the dialog for intercepting notification messages since the application itself created the dialog. Is there any other way I can get these strings? Please help!
0
Comment
Question by:nadirkamal
1 Comment
 
LVL 3

Accepted Solution

by:
akalmani earned 140 total points
ID: 2407662
Hi nadirkamal !!
   Hey override the following functions in CMainFrame class for ID_FILE_OPEN and ID_FILE_SAVE

For open
void CMainFrame::OnFileOpen()
{
    CFileDialog dlg(true);
    if(dlg.DoModal() == IDOK)
    {
        dlg.m_ofn.lpstrFile //contains the file name with extension
   }
}

For save
void CMainFrame::OnFileSave()
{
    CFileDialog dlg(false);
    if(dlg.DoModal() == IDOK)
    {
        dlg.m_ofn.lpstrFile //contains the file name with extension
   }
}
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

607 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question