Solved

Problem with CFileDialog

Posted on 1998-10-06
4
272 Views
Last Modified: 2013-11-20
I am probably missing something really stupid here, but when I try to call the contructor for CFileDialog, I get no default constructor available.  I am using CFileDialog as the constructor.  I don't get the error if I use CFontDialog or any of the other common dialog boxes.  What am I doing wrong?  Thanks.
0
Comment
Question by:Jothanin
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 3

Accepted Solution

by:
shaig earned 20 total points
ID: 1323046
CFileDialog does not have a default constructor, you must specify one parameter atleast ( check the documentation ).
0
 

Expert Comment

by:gvnmsunil
ID: 1323047
I think the problem is with the parameters you had passed to the constructor.
If you can post the line for which you are facing problem it is better.
0
 

Author Comment

by:Jothanin
ID: 1323048
CFileDialog(TRUE, NULL, NULL, NULL, NULL) m_filedlg;

I am a newbie and have never had to mess with classes with no
default constructor, so that may be totally wrong.  With the parameters
I get:

 error C2629: unexpected 'class CFileDialog ('
error C2238: unexpected token(s) preceding ';'

as an error.

Thanks.
0
 
LVL 3

Expert Comment

by:shaig
ID: 1323049
Try
CFileDialog instanceName( TRUE );
Remember: your object name should be specified, you are not tring to declare the class again.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Windows Drag & Drop Location 2 116
bobThere java chalenge 45 97
no14 challenge 14 76
Execute multiple curl cmds with sleep and send output to file 10 120
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses

738 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