等待高手出现...两次调用OpenDocumentFile出错(可给50分)
CMainFrame::OnFileNew()
{
CNewDialog dlg(this);
if(dlg.DoModal() == IDOK)
{
CreateDir(strFilePath);//新建一个目录
CString temp="";
CString tempFile="";
temp=strFilePath;
temp.operator += ("\\");
temp.operator += (strFileName);
if(iOperator==0)//建立新的项目
{
if(!InitPBTree(strFileName))
{
return;
}
//建立头文件
tempFile=temp;
tempFile.operator += (".h");
SetbFile(TRUE);
IsShowInWorkspace = TRUE;
pApp->OpenDocumentFile((LPCTSTR)tempFile);//error 第一次可以运行,但第2次就程序出错,出现发送错误的对话框
}
}
我在前面每句加return;都不出错,直到打开文件那句.
各位高手这是什么原因呢?若不够还可用下面贴加分:
http://community.csdn.net/Expert/topic/5620/5620800.xml?temp=.9835626