12-19-2007, 10:20
|
tteveris@gspinc.com
Joined on 12-03-2003
Posts 49
|
L_DlgOpen - multiple files
|
 
 
|
|
|
Attempting to use L_DlgOpen() to open a number of files returns only the data for one file (seems like the last one I selected).
Upon a successful return from L_DlgOpen() the foParm.nNumOfFiles contains the correct number of files but only foParm.pFileData[0] contains good info. pFileData[1], [2]…. Contain garbage.
I’m assuming my setup is incorrect but I can’t figure out what. The attached simple app shows the problem.
Thanks in advance
I did send a small project to support@leadtools.com but have not heard anything. I also thought I would share the problem with all and hopefully a solution.
void CLeadDlgDlg::OnBnClickedOk()
{
OPENFILENAME OpenFileName;
OPENDLGPARAMS foParm;
L_INT nRet, index;
L_INT nI;
L_INT nFilterIndex;
L_INT nMin, nMax;
const TCHAR m_szOpenFilter [ ] =
{
TEXT("Popular Media Types\0") TEXT("*.CMP;*.jpg;*.jpeg;*.cmw;*.j2k;*.tif;*.tiff;*.gif;*.png;*.ani;*.bmp;*.cur;*.ico;*.icon;*.wmf;*.dic\0")
// Display String Filter
// LEAD Constant formats order
TEXT( "LEAD (*.cmp)\0" ) TEXT( "*.cmp\0" )
TEXT( "JPEG (*.jpg;*.jpeg;*.jtf)\0" ) TEXT( "*.jpg;*.jpeg;*.jtf\0" )
TEXT( "CMW (*.cmw)\0" ) TEXT( "*.cmw\0" )
TEXT( "JPEG 2000 (*.j2k;*.jp2)\0" ) TEXT( "*.j2k;*.jp2\0" )
TEXT( "TIFF (*.tif;*.tiff)\0" ) TEXT( "*.tif;*.tiff\0" )
TEXT( "GIF (*.gif)\0" ) TEXT( "*.gif\0" )
TEXT( "PNG (*.png)\0" ) TEXT( "*.png\0" )
TEXT( "\0" )
};
memset(&OpenFileName, 0, sizeof(OPENFILENAME));
memset(&foParm, 0, sizeof(OPENDLGPARAMS));
OpenFileName.lStructSize = sizeof(OPENFILENAME);
OpenFileName.lpstrFilter = m_szOpenFilter;//TEXT("Popular Media Types\0 *.CMP;*.jpg;*.jpeg;*.cmw;*.j2k;*.tif;*.tiff;*.gif;*.png;*.ani;*.bmp;*.cur;*.ico;*.icon;*.wmf;*.dic\0All Files(*.*)\0*.*");
OpenFileName.nFilterIndex = 0;//nFilterIndex;
// OpenFileName.nMaxCustFilter = 12;
OpenFileName.hwndOwner = this->m_hWnd;
OpenFileName.lpstrTitle = "Open File";
OpenFileName.Flags = OFN_ALLOWMULTISELECT;
OpenFileName.lpstrInitialDir = "C:\\Images";
foParm.bShowLoadOptions = FALSE;
foParm.bPreviewEnabled = TRUE;
foParm.uStructSize = sizeof(OPENDLGPARAMS);
foParm.uDlgFlags = DLG_OPEN_ENABLESIZING |
DLG_OPEN_SHOW_PREVIEW |
DLG_OPEN_USEFILESTAMP |
DLG_OPEN_SHOW_PROGRESSIVE |
DLG_OPEN_SHOW_MULTIPAGE |
DLG_OPEN_SHOW_DELPAGE |
//DLG_OPEN_SHOW_LOADROTATED |
DLG_OPEN_SHOW_LOADCOMPRESSED |
//DLG_OPEN_SHOW_LOADOPTIONS |
DLG_OPEN_SHOW_FILEINFO |
//DLG_OPEN_SHOW_PDFOPTIONS |
DLG_OPEN_SHOW_RASTEROPTIONS |
DLG_OPEN_SHOW_VECTOROPTIONS |
DLG_OPEN_VIEWTOTALPAGES |
DLG_OPEN_LOADBITMAP;
nRet = L_DlgInit ( DLG_INIT_COLOR ) ;
if(nRet != SUCCESS && nRet != ERROR_DLG_ALREADYINITIATED)
return;
nRet = L_DlgOpen( this->m_hWnd, &OpenFileName, &foParm);
if(nRet == SUCCESS_DLG_OK )
{
nFilterIndex = OpenFileName.nFilterIndex;
for ( nI = 0 ; nI < foParm.nNumOfFiles ; nI++ )
{
if ( NULL != foParm.pFileData[nI].pFileInfo )
{
}
}
CleanOpenDlgParam(&foParm);
}
else
AfxMessageBox("Can't open file", MB_OK);
L_DlgFree();
}
|
|
|
|
|
Report
|
|
|
|