为何在打开多个文件时有时没有反应?
我重载了ID_FILE_OPEN进行打开多个文件,有时选文件多了,并不打开文件,去掉一个或两个选择的文件,就可以打开,这是为什么?代码如下:
.......
CFileDialog dlgFile(TRUE);
.......
POSITION pos = NULL;
if (dlgFile.DoModal() == IDOK)
{
pos = dlgFile.GetStartPosition();
while(pos)
{
theApp.OpenDocumentFile(dlgFile.GetNextPathName(pos));
}
}
........
问题点数:20、回复次数:4Top
1 楼Mackz(在相互)回复于 2006-03-23 01:48:13 得分 2
缓冲区不够。Top
2 楼lixiaosan(小三)回复于 2006-03-23 09:00:00 得分 16
CFileDialog dlg( 。。。 );
dlg.m_ofn.nMaxFile = 1024;
char* buf = new char[2048]; //足够大
dlg.m_ofn.lpstrFile = buf;
dlg.m_ofn.lpstrFile[0] = NULL;Top
3 楼cici2006(以不变应万变)回复于 2006-03-23 09:09:28 得分 2
缓冲区不够。Top
4 楼zxphxh(天雨)回复于 2006-03-23 19:10:10 得分 0
非常感谢!Top




