confusingbird 2016-08-14 11:20 采纳率: 0%
浏览 1888
已结题

MFC CfileDialog闪退,到底是什么鬼啊,我要爆炸了在线急等

CFileDialog Dlg(FALSE, NULL, NULL, OFN_EXPLORER|OFN_READONLY,"文本文件 (*.txt)|*.obj|All Files (*.*)|*.*||");

CString strReadFileName;
char *file12;
if(Dlg.DoModal ()==IDOK)
{
strReadFileName=Dlg.GetPathName ();
int strLength =strReadFileName.GetLength() + 1;
char *pValue = new char[strLength];
strncpy(pValue, strReadFileName, strLength);
file12 =pValue;
file=file12;
}

  • 写回答

2条回答 默认 最新

  • MelancholyCrow 2016-08-14 13:31
    关注

    new一个就好了,不要定义对象

    评论

报告相同问题?