I'm following the definition for CFileDialog
, yet VS2013 is still telling me that there is no constructor available for the arguments that I'm passing in.
My Code:
CFile theFile;
char strFilter[] = { "TXT Files (*.txt)|*.txt|All Files (*.*)|*.*||" };
CFileDialog fDlg = CFileDialog(TRUE, ".txt", NULL, 0, strFilter);
Resulting Error:
1 IntelliSense: no instance of constructor "CFileDialog::CFileDialog" matches the argument list argument types are: (int, const char [5], int, int, char [46]) c:\Users\Jonathan\Documents\Visual Studio 2013\Projects\SDI\SDI\MainFrm.cpp 131 21 SDI
And the CFileDialog
constructor for reference:
explicit CFileDialog(BOOL bOpenFileDialog, // TRUE for FileOpen, FALSE for FileSaveAs
LPCTSTR lpszDefExt = NULL,
LPCTSTR lpszFileName = NULL,
DWORD dwFlags = OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
LPCTSTR lpszFilter = NULL,
CWnd* pParentWnd = NULL,
DWORD dwSize = 0,
BOOL bVistaStyle = TRUE);
What's the problem?