• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 282
  • Last Modified:

Problem with CFileDialog

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
Jothanin
Asked:
Jothanin
  • 2
1 Solution
 
shaigCommented:
CFileDialog does not have a default constructor, you must specify one parameter atleast ( check the documentation ).
0
 
gvnmsunilCommented:
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
 
JothaninAuthor Commented:
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
 
shaigCommented:
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!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now