views:

32

answers:

1

When you select a number of files on OpenFileDialog you get the working directory path in a structure member of OPENFILENAME but when you select a single file you get the path to filename in that variable member.

Would there be a possible way to get the path first before looping and counting to check the number of files?

+1  A: 

Not quite sure what you mean, OpenFileDialog is a .NET class. Assuming native: you can set the OPENFILENAME.lpfnHook member to a callback function. That gives you notifications like CDN_FILEOK and CDN_FOLDERCHANGE. Gives you a preview of what was selected before the dialog closes and a way to cancel it.

Hans Passant
Yes, CDN_FOLDERCHANGE is what i needed so then CDM_GETFOLDERPATH can get the path to current working directory.
Dave18