G
Guest
I know that I get pretty dumb late in the day, so I hope someone can just
point out the source my stupidity.
Below is partial code from a class. I'm accessing the 2 properties and
getting truncated results for both. For discussion's sake I'll just describe
1 of them - 'DefaultFileExtension'. This property's ReadOnly method calls the
'GetDefaultFileExtensions' function which should return the value of a
constant, which in this case is "*.pdf". Look at the 2 'MsgBox' items in the
code. I put them there for debugging. The message box inside of the
'GetDefaultFileExtensions' function displays "*.pdf". The message box in the
'DefaultFileExtension. property get displays "*" as the returned value from
'GetDefaultFileExtensions'.
I've tried replacing the sReturn variable with the literal "*.pdf" and still
get the same result. Also recompiled, and even rebooted.
I'm stumped and open to suggestions.
Thanks, Tom
'******************************************
Friend Class clsFileDefinitionStructure
Friend Enum fdFileType
PDF_ft
Image_ft
End Enum
Private Const mc_DefaultFiletypeDescription_PDF As String = "PDF files"
Private Const mc_DefaultFiletypeDescription_Image As String = "Image
files"
Private Const mc_DefaultFileExtension_PDF As String = "*.pdf"
Private Const mc_DefaultFileExtension_Image As String =
"*.gif;*.bmp;*.jpg;*.jpeg;*.tif;*.png;*.pcd;*.pcx"
Private m_FileType As fdFileType = fdFileType.PDF_ft
Friend ReadOnly Property DefaultFileExtension() As String
Get
MsgBox(GetDefaultFileExtensions(m_FileType))
Return GetDefaultFileExtensions(m_FileType)
End Get
End Property
Friend ReadOnly Property DefaultFileTypeDescription() As String
Get
Return GetDefaultFileTypeDescription(m_FileType)
End Get
End Property
Private Function GetDefaultFileExtensions() As String
Dim sReturn As String
Select Case m_FileType
Case fdFileType.Image_ft
sReturn = mc_DefaultFileExtension_Image
Case fdFileType.PDF_ft
sReturn = mc_DefaultFileExtension_PDF
Case Else
sReturn = "*.*"
End Select
MsgBox(sReturn)
Return sReturn
End Function
Private Function GetDefaultFileTypeDescription() As String
Dim sReturn As String
Select Case m_FileType
Case fdFileType.Image_ft
sReturn = mc_DefaultFiletypeDescription_Image
Case fdFileType.PDF_ft
sReturn = mc_DefaultFiletypeDescription_PDF
Case Else
sReturn = "All Files"
End Select
Return sReturn
End Function
End Class
point out the source my stupidity.
Below is partial code from a class. I'm accessing the 2 properties and
getting truncated results for both. For discussion's sake I'll just describe
1 of them - 'DefaultFileExtension'. This property's ReadOnly method calls the
'GetDefaultFileExtensions' function which should return the value of a
constant, which in this case is "*.pdf". Look at the 2 'MsgBox' items in the
code. I put them there for debugging. The message box inside of the
'GetDefaultFileExtensions' function displays "*.pdf". The message box in the
'DefaultFileExtension. property get displays "*" as the returned value from
'GetDefaultFileExtensions'.
I've tried replacing the sReturn variable with the literal "*.pdf" and still
get the same result. Also recompiled, and even rebooted.
I'm stumped and open to suggestions.
Thanks, Tom
'******************************************
Friend Class clsFileDefinitionStructure
Friend Enum fdFileType
PDF_ft
Image_ft
End Enum
Private Const mc_DefaultFiletypeDescription_PDF As String = "PDF files"
Private Const mc_DefaultFiletypeDescription_Image As String = "Image
files"
Private Const mc_DefaultFileExtension_PDF As String = "*.pdf"
Private Const mc_DefaultFileExtension_Image As String =
"*.gif;*.bmp;*.jpg;*.jpeg;*.tif;*.png;*.pcd;*.pcx"
Private m_FileType As fdFileType = fdFileType.PDF_ft
Friend ReadOnly Property DefaultFileExtension() As String
Get
MsgBox(GetDefaultFileExtensions(m_FileType))
Return GetDefaultFileExtensions(m_FileType)
End Get
End Property
Friend ReadOnly Property DefaultFileTypeDescription() As String
Get
Return GetDefaultFileTypeDescription(m_FileType)
End Get
End Property
Private Function GetDefaultFileExtensions() As String
Dim sReturn As String
Select Case m_FileType
Case fdFileType.Image_ft
sReturn = mc_DefaultFileExtension_Image
Case fdFileType.PDF_ft
sReturn = mc_DefaultFileExtension_PDF
Case Else
sReturn = "*.*"
End Select
MsgBox(sReturn)
Return sReturn
End Function
Private Function GetDefaultFileTypeDescription() As String
Dim sReturn As String
Select Case m_FileType
Case fdFileType.Image_ft
sReturn = mc_DefaultFiletypeDescription_Image
Case fdFileType.PDF_ft
sReturn = mc_DefaultFiletypeDescription_PDF
Case Else
sReturn = "All Files"
End Select
Return sReturn
End Function
End Class