Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Wednesday, April 23, 2008 12:46:39 PM(UTC)
matthew.gaskill

Groups: Registered
Posts: 6


When choosing a file using Open Dialog the FileName property no longer returns the short file name. I am upgrading from v13.5 to v14.5.

So when the folder and/or filename have a space, there is no way I can logically parse the string.

I have listed the output below. There is nothing I can do with the filename from version 14.5. Am I missing a property or flag?

Version 13.5
- FileName = "C:\Users\MATTHE~1.GAS\Desktop\TESTFO~1 IAN~1.BMP"

Version 14.5
- FileName = "C:\Users\matthew.gaskill\Desktop\test folder with spaces I an.bmp "


Here is my code.

Call DialogKernal.InitDlg(1)

oFileDlg.Filter = "JPEG|*.jpg|BMP|*.bmp|GIF|*.gif"
oFileDlg.EnableShowPreview = True
oFileDlg.UIFlags = 64
oFileDlg.FileDlgFlags = 512
oFileDlg.DialogTitle = "Open A File"
oFileDlg.FilterIndex = 0
oFileDlg.InitialDir = "C:\"
oFileDlg.Bitmap = 0

Call oFileDlg.ShowOpenDlg (0)

file.value = oFileDlg.FileName

Call DialogKernal.FreeDlg()
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Thursday, April 24, 2008 9:08:41 AM(UTC)

Adam Boulad  
Guest

Groups: Guests
Posts: 3,022

Was thanked: 2 time(s) in 2 post(s)


This
happens when you set the FileDlgFlags to OPEN_ALLOWMULTI (512), in order to use
the OPEN_ALLOWMULTI with the FileName property returning the correct path, you
must handle the oFileDlg_FileLoad event. Please find below the code sample that will do that:


 


'++++++++++++++++++++++++++++


Option Explicit


 


Dim WithEvents oFileDlg As LEADRasterDlgFile


'if you want to use OPEN_ALLOWMULTI, you must


' handle the oFileDlg_FileLoad event


 


Private Sub Command1_Click(Index As Integer)


Set oFileDlg = New LEADRasterDlgFile


Dim DialogKernal As New LEADRasterDlgKrn


Dim nRet As Integer


Call DialogKernal.InitDlg(1)


  


oFileDlg.Filter = "JPEG|*.jpg|BMP|*.bmp|GIF|*.gif"


oFileDlg.EnableShowPreview = True


oFileDlg.UIFlags = 64


oFileDlg.FileDlgFlags = OPEN_ALLOWMULTI '512


oFileDlg.DialogTitle = "Open A File"


oFileDlg.FilterIndex = 0


oFileDlg.InitialDir = "C:\Temp\Temp 1"


oFileDlg.Bitmap = 0


Call oFileDlg.ShowOpenDlg(0)


  


Call DialogKernal.FreeDlg


End Sub


 


Private
Sub oFileDlg_FileLoad(ByVal iTotalPercent As Integer, ByVal FilePercent As Integer)


If (FilePercent = 100) Then


MsgBox oFileDlg.FileName


End If


End Sub


'++++++++++++++++++++++++++++

 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.285 seconds.