Menu

#18 CFileDialog: GetOpenSaveFileName

open
nobody
None
5
2004-07-12
2004-07-12
Anonymous
No

'// return the file title
.lpstrFileTitle = Left$(.lpstrFileTitle, _
InStr(.lpstrFileTitle, vbNullChar) - 1)

'// return the selected file's extension using
'//the nFileExtension
.lpstrDefExt = Mid$(Left$(.lpstrFile, _
InStr(.lpstrFile, vbNullChar) _
- 1), .nFileExtension + 1)

The order of these lines means that the second line is looking for a nullchar in a string which was already removed in the previous line. Solved by swapping the order of the lines.

Discussion


Log in to post a comment.