CFileDialog: GetOpenSaveFileName
Brought to you by:
kprobst
'// 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.