hi guy's
here is one problem i am facing.
actually i am a new bee in mfc so please help.
it is a problem related with multiple file selection.
i am able to get only upto 10 filenames by following method.
my problem is the folllowing code is working for only 10-12 files.
void CMainFrame::OnProjectAddfile()
{
CFileDialog openDialog( TRUE, _T(""),_T(""),
OFN_READONLY|
OFN_HIDEREADONLY|
OFN_PATHMUSTEXIST|
OFN_ALLOWMULTISELECT,
_T("C Files (*.c)|*.c|(*.s)|*.s|(*.h)|*.h||"));
if(openDialog.DoModal()==IDOK)
{
POSITION ps;
CString MultiFileName[MAX_PATH];
int FileNumber=0;
ps=openDialog.GetStartPosition();
while(ps)
{
MultiFileName[FileNumber]=openDialog.GetNextPathName(ps);
FileNumber++;
}
}
}
so i tried this
void CMainFrame::OnProjectAddfile()
{
CFileDialog openDialog( TRUE, _T(""),_T(""),
OFN_READONLY|
OFN_HIDEREADONLY|
OFN_PATHMUSTEXIST|
OFN_ALLOWMULTISELECT,
_T("C Files (*.c)|*.c|(*.s)|*.s|(*.h)|*.h||"));
LPSTR ptr = new char[50 * MAX_PATH];
memset(ptr,0,50*MAX_PATH);
openDialog.m_ofn.lpstrFile = ptr;
if(openDialog.DoModal()==IDOK)
{
POSITION ps;
CString MultiFileName[MAX_PATH];
int FileNumber=0;
ps=openDialog.GetStartPosition();
while(ps)
{
MultiFileName[FileNumber]=openDialog.GetNextPathName(ps);
FileNumber++;
}
}
delete []ptr;
}
but then also the problem did not got solved.
openDialog.DoModal() is actually returning IDCANCEL when i select more
than 12 files
please help me it's very important for my project.
Regards and thank's in advance
Harshal shete