Welcome to LEAD Support Forum Login | Register | Faq  

    LEAD Support Forum
  Resource to find answers and post technical questions about LEAD products.
Search    
   

L_DlgOpen - multiple files
Started by tteveris@gspinc.com at 12-19-2007 10:20. Topic has 3 replies.

Print Search « Previous Thread Next Thread »
  12-19-2007, 10:20
tteveris@gspinc.com is not online. Last active: 2/11/2008 3:49:45 PM tteveris@gspinc.com

Top 50 Posts
Joined on 12-03-2003
Posts 48
L_DlgOpen - multiple files
Reply Quote
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 
  12-21-2007, 10:25
GregR is not online. Last active: 9/30/2008 12:26:32 PM GregR



Top 10 Posts
Joined on 05-31-2006
In House
Posts 1,607
Re: L_DlgOpen - multiple files
Reply Quote
No files were attached, and I couldn't find an email from you regarding this topic =(.  Please reattach your project.

NOTE: If you are attaching a project or file to the forums...
1.) Zip the file(s) up.
2.) Make sure it is less than 5 MB.  If it is larger, please send an email to support@leadtools.com and we'll send you FTP instructions.
3.) Remove ANY AND ALL unlock codes and LEADTOOLS DLLs.
4.) Do not click the preview button, the attachment will not show up when you post it.
 
If you do not wish to post your file(s) on the forum since they are publically viewable, please send an email to support@leadtools.com and make sure that you include a link to this forum post.


Greg Ross
LEADTOOLS Technical Support
   Report 
  01-22-2008, 20:50
tteveris@gspinc.com is not online. Last active: 2/11/2008 3:49:45 PM tteveris@gspinc.com

Top 50 Posts
Joined on 12-03-2003
Posts 48
Re: L_DlgOpen - multiple files
Reply Quote
Greg don't know what happen to the email, but I was looking that this problem today and what I found was that if I build the project with UNICODE everything works fine, if built without UNICODE (what I need) it does not work. I also noticed that the data structure sizes in all the uStructSize variables were the same no matter how it was compiled so it looked like the function is only supported using UNICODE.

I will attempt to send the test project tomorrow (Wed - Jan 23)

   Report 
  01-23-2008, 9:42
GregR is not online. Last active: 9/30/2008 12:26:32 PM GregR



Top 10 Posts
Joined on 05-31-2006
In House
Posts 1,607
Re: L_DlgOpen - multiple files
Reply Quote
I got the test project and have answered you via email.

Greg Ross
LEADTOOLS Technical Support
   Report 
Post
LEAD Support Fo... » Developer » Common Dialogs » L_DlgOpen - multiple files

Powered by Community Server, by Telligent Systems