Welcome to LEAD Support Forum Login | Register | Faq  

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

OpenDlg and initial dir
Started by Torsten at 06-12-2007 3:33. Topic has 6 replies.

Print Search « Previous Thread Next Thread »
  06-12-2007, 3:33
Torsten is not online. Last active: 6/12/2007 8:29:02 AM Torsten

Not Ranked
Joined on 06-12-2007
Posts 4
OpenDlg and initial dir
Reply Quote
I have a problem with initial dirictory.
I set right parametr and call function, but function ignore my parameter and open dialog with last opening state.

See my function in attachment.

The administrator has denied uploads of certain file types and the file must have only one extension (filename.ext).
hm, opendlg.cpp - file have more than one extension ???

ok, i posted right here
bool OpenFileLTDlg(CWnd * pParent, CString & path, LPCTSTR initial_dir)
{
L_INT nRet;
L_BOOL fAutoProcess = FALSE;
OPENFILENAME OpenFileName;
OPENDLGPARAMS FOParm;
L_BOOL bEnablePreview = TRUE;
L_BOOL fShowPreview = TRUE;
L_BOOL fLoadCompressed = TRUE;
L_BOOL fLoadRotated = TRUE;
L_BOOL fShowResize = TRUE;
L_BOOL fTotalPages = TRUE;
L_BOOL fDoPaintWhileLoad = FALSE;

memset(&FOParm, 0, sizeof(OPENDLGPARAMS));
memset(&OpenFileName, 0, sizeof(OPENFILENAME));

FOParm.uStructSize = sizeof(OPENDLGPARAMS);
FOParm.bShowLoadOptions = FALSE;
FOParm.bPreviewEnabled = bEnablePreview;
FOParm.uDlgFlags = (fShowResize?DLG_OPEN_ENABLESIZING:0) |
(fShowPreview?DLG_OPEN_SHOW_PREVIEW:0) |
(fShowPreview?DLG_OPEN_USEFILESTAMP:0) |
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 |
(fLoadRotated ?DLG_OPEN_ALWAYSLOADROTATED:0) |
(fLoadCompressed?DLG_OPEN_ALWAYSLOADCOMPRESSED:0) |
(fTotalPages?DLG_OPEN_VIEWTOTALPAGES:0);

if(fDoPaintWhileLoad)
fAutoProcess = FALSE;

OpenFileName.lStructSize = sizeof(OPENFILENAME);
OpenFileName.hwndOwner = pParent->GetSafeHwnd();
OpenFileName.nFilterIndex = 0;
OpenFileName.lpstrTitle = 0;
<b> OpenFileName.lpstrInitialDir = initial_dir; // Init the initial dir</b>

nRet = L_DlgOpen( pParent->GetSafeHwnd(),&OpenFileName,&FOParm );

if (nRet == SUCCESS_DLG_OK)
{
path =FOParm.pFileData[0].szFileName;
return true;
}

return false;
}
   Report 
  06-13-2007, 9:12
Maen Hasan is not online. Last active: 8/14/2008 8:56:49 AM Maen Hasan



Top 10 Posts
Joined on 08-05-2004
Posts 1,715
Re: OpenDlg and initial dir
Reply Quote
Hello,

If you want to attach files, please put them all in one ZIP or RAR file. Also, it's usually better to put a complete working project that shows the problem using minimum code (not your full application).

About the problem you're facing, my guess is that you are using LEADTOOLS 14.5 because the structure and function names are similar to that version. Is this correct?
In any case, I think this is a limitation in the common dialogs imposed by the operating system. In Windows 2000/XP, if lpstrFile contains a path, that path is the initial directory. Otherwise, lpstrInitialDir specifies the initial directory.

There are other details involved, and it is also different on other operating systems. Try to set the same path in lpstrFile also. If it doesn't work, tell me which OS you're using and attach a small project in a ZIP or RAR file.

Thanks,
Maen Badwan
LEADTOOLS Technical Support
   Report 
  06-14-2007, 1:07
Torsten is not online. Last active: 6/12/2007 8:29:02 AM Torsten

Not Ranked
Joined on 06-12-2007
Posts 4
Re: OpenDlg and initial dir

Attachment: OpenDlgLT.zip
Reply Quote
<BLOCKQUOTE><table width="85%"><tr><td class="txt4"><img src="/SupportPortal/cs/Themes/default/images/icon-quote.gif">&nbsp;<strong>Maen Hasan wrote:</strong></td></tr><tr><td class="quoteTable"><table width="100%"><tr><td width="100%" valign="top" class="txt4">In any case, I think this is a limitation in the common dialogs imposed by the operating system. In Windows 2000/XP, if lpstrFile contains a path, that path is the initial directory. Otherwise, lpstrInitialDir specifies the initial directory.</td></tr></table></td></tr></table></BLOCKQUOTE>

I not think so. I create test project, with LT Open file dialog and common open file dialog. I inititialized only lpstrInititialDir and common open file dialog works correctly. LT open file dialog opens previous folder.

Please, see that.
Project details : include and library paths to LT sets in project settings.
My LT version :15 with patch.
MY OS version : XP SP 2
My VS version : VS 2005 SP 1
   Report 
  06-17-2007, 5:48
Maen Hasan is not online. Last active: 8/14/2008 8:56:49 AM Maen Hasan



Top 10 Posts
Joined on 08-05-2004
Posts 1,715
Re: OpenDlg and initial dir
Reply Quote
Hello,

I checked the same issue using your code and noticed that the LT open dialog and the common open dialog work correctly.
The problem might be related to the LEADTOOLS v15 DLLs and headers that you use.
Please retry the same issue using the latest LEADTOOLS v15 API patch. To obtain the latest v15 API patch, please send your LEADTOOLS v15 serial number to support@leadtools.com and ask about the latest LEADTOOLS v15 API patch.

Thanks,
Maen Badwan
LEADTOOLS Technical Support
   Report 
  06-24-2007, 5:46
Torsten is not online. Last active: 6/12/2007 8:29:02 AM Torsten

Not Ranked
Joined on 06-12-2007
Posts 4
Re: OpenDlg and initial dir
Reply Quote
Ok, thanks.
I downloaded latest patch and now dialogs works corretly.
   Report 
  06-29-2007, 15:19
Torsten is not online. Last active: 6/12/2007 8:29:02 AM Torsten

Not Ranked
Joined on 06-12-2007
Posts 4
Re: OpenDlg and initial dir

Attachment: LFileTrouble.zip
Reply Quote
Dialogs works corretly, but other ...
I try to use LT 15 with 13-06-2007 patch on big projects and found some troubles.

I have are linker error with LFile methods. In debug output i see " unresolved external symbol " with LFile methods so as LFile::SetFilename, LFile::GetInfo, LFIle::Load. Before 13-06-2007 patch LFile methods works without problem.

I attached test project with my trouble.
   Report 
  07-02-2007, 5:55
Qasem Lubani is not online. Last active: 9/2/2008 11:31:52 AM Qasem Lubani



Top 10 Posts
Joined on 08-13-2006
Posts 1,044
Re: OpenDlg and initial dir
Reply Quote
Your project does not use the Unicode character set therefore it's not compatible with our ClassLib DLLs. However, a new build for the ANSI ClassLib DLLs is coming soon.
Qasem Al-Lubani
LEAD Technical Support
www.leadtools.com
   Report 
Post
LEAD Support Fo... » Developer » Common Dialogs » OpenDlg and initial dir

Powered by Community Server, by Telligent Systems