Solved

Problem with CFileDialog

Posted on 1998-10-06
4
268 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
  • 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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
repeatEnd java challenge 42 84
Get filename and folder into excel 7 76
noX challenge 17 117
unix example issues 18 90
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

809 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