Welcome to LEAD Support Forum Login | Register | Faq  

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

FileName property is not usable.
Started by matthew.gaskill@tylertech.com at 04-23-2008 17:51. Topic has 1 replies.

Print Search « Previous Thread Next Thread »
  04-23-2008, 17:51
matthew.gaskill@tylertech.com is not online. Last active: 5/13/2008 7:37:46 PM matthew.gaskill@tylertech.com

Top 500 Posts
Joined on 04-08-2008
Posts 9
FileName property is not usable.
Reply Quote
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()

   Report 
  04-24-2008, 14:13
Adam Boulad is not online. Last active: 7/23/2008 4:14:05 PM Adam Boulad



Top 10 Posts
Joined on 09-16-2007
Posts 406
Re: FileName property is not usable.
Reply Quote

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

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


Adam Boulad
LEADTOOLS Technical Support

   Report 
Post
LEAD Support Fo... » Developer » Common Dialogs » FileName property is not usable.

Powered by Community Server, by Telligent Systems