This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Wednesday, April 23, 2008 12:46:39 PM(UTC)
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()
#2
Posted
:
Thursday, April 24, 2008 9:08:41 AM(UTC)
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.