帮忙看看,为什么没有适当的默认构造函数可利用
程序代码:
class CFileSplitter : public CFileDialog { DECLARE_DYNAMIC(CFileSplitter) public: CFileSplitter(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); //声明; public: CFileSplitter( DWORD dwBlockSize, CString strFilePath); public: DWORD m_dwBlockSize;//块大小 DWORD m_dwFileSize;//文件大小 CString m_strFilePath;//文件路径 public: void Split();//分割文件 void Join();//合并文件 protected: //{{AFX_MSG(CFileSplitter) // NOTE - the ClassWizard will add and remove member functions here. //}}AFX_MSG DECLARE_MESSAGE_MAP() }; //实现; CFileSplitter::CFileSplitter( DWORD dwBlockSize, CString strFilePath) { m_dwBlockSize = dwBlockSize *1024; m_dwFileSize = 0; m_strFilePath = strFilePath; } void CFileSplitter::Split() { //打开文件 CFile file; file.Open(m_strFilePath, //文件路径 CFile::modeRead|CFile::typeBinary); //以二进制方式读取数据 //获得文件长度 this->m_dwFileSize = file.GetLength(); //检测数据合法性 if(m_dwBlockSize > m_dwFileSize) { ::MessageBox(NULL,"文件块大小大于文件大小!","错误",MB_OK); return; } //开始分割 int nFileIndex = 0; DWORD offset = 0; char buf[4096] = {0}; char *p = buf; CFile fileWriter; DWORD dwTempBlockSize = 0; //不停的在文件中读取数据 while(1) { if(offset == 0) { //生成文件名 char szFileName[255] = {0}; sprintf(szFileName,"%s.%d",m_strFilePath,nFileIndex++); //打开文件 fileWriter.Open(szFileName, CFile::modeWrite|CFile::modeCreate|CFile::typeBinary); } //读取数据 UINT nReadLen; if(m_dwBlockSize - offset >= 4096) { nReadLen = file.Read(buf,4096); } else { nReadLen = file.Read(buf,m_dwBlockSize - offset); } if(nReadLen == 0) { //文件中没有数据可以读 fileWriter.Close(); break; } //写入数据 fileWriter.Write(buf,nReadLen); offset += nReadLen; if(offset == m_dwBlockSize) { //关闭文件 offset = 0; fileWriter.Close(); } } file.Close(); //关闭文件 }filesplitter.h(38) : error C2512: 'CFileDialog' : no appropriate default constructor available
为什么提示说,没有适当的默认构造函数可利用