CFileFind finder;
CString pathname;
BOOL bk = finder.FindFile("C:\\bmps\\*.bmp");
while(bk)
{
bk = finder.FindNextFile();
pathname = finder.GetFilePath();
if(m_hPhotoBitmap)
{
DeleteObject(m_hPhotoBitmap);//清除HBITMAP对象
m_hPhotoBitmap = NULL;
}
if(m_pBMPBuffer)
{
delete m_pBMPBuffer;
m_pBMPBuffer = NULL;
}
CFile file;
if( !file.Open(pathname, CFile::modeRead))//打开BMP文件
return;
m_nFileLen = file.GetLength();//文件长度
m_pBMPBuffer = new char[m_nFileLen + 1];//分配内存
if(!m_pBMPBuffer)//分配失败
return;
if(file.ReadHuge(m_pBMPBuffer,m_nFileLen) != m_nFileLen)//读取文件数据到缓存
return;
m_hPhotoBitmap = BufferToHBITMAP();//将内存中的BMP文件内容转换到HBITMAP
Sleep(2000);
Invalidate();
           }
帮忙看下,这段程序是不是把XXX.bmp图片遍历完就会退出循环,还有就是在循环里执行Invalidate();不会引起OPaint的执行,这个是为什么呢?感谢帮忙