###c++
void CDlgToolWinSingle::OnBnClickedButton1()
{
CString str; char szFilter[] = "PNG Files(*.PNG)
|*.PNG
|All Files(*.*)|*.*||";
char allfilepath[1024];
memset(allfilepath,0x00,sizeof(allfilepath));
CString strTemp = "test";
char* pc = new char[MAXFILE];
CFileDialog dlg(TRUE,
NULL,
NULL,
OFN_HIDEREADONLY
| OFN_ALLOWMULTISELECT,
szFilter,
this);
DWORD MAXFILE = 2562; //2562 is the max
dlg.m_ofn.nMaxFile = MAXFILE; //최대 선택 파일 수 설정
dlg.m_ofn.lpstrFile = pc;
dlg.m_ofn.lpstrFile[0] = NULL;
dlg.m_ofn.lpstrTitle = strTemp.GetBuffer(strTemp.GetLength()); dlg.m_ofn.lpstrInitialDir = ".\\";
dlg.m_ofn.lpstrDefExt = "png";
if(dlg.DoModal() != IDCANCEL)
{
for(POSITION pos = dlg.GetStartPosition() ; pos != NULL ;)
AddTexture(dlg.GetNextPathName(pos));
}
delete [] pc;
UpdateTextureList();
}