but it doesn't work, it only returns a bunch of numbers, does anyone know whats wrong with it or know an example where it will open a dialog and then actually use the string for something?
It may just not be written here but you never give a path or a file name
its supposed to prompt the user for a filename using an "open file" dialog and then return the path, it opens the dialog but just returns a bunch of numbers. how do i fix it?
Ok, I see your code diplays the prompt on line "17" and tests if for true, by the way BOOL in Windows is NOT the same as bool for C++ make sure you've taken that into account, but then if it's true you assign fileName to fileNameStr and return that. I don't see what you've done with the data stored in ofn. ofn should probably be a pointer to a OPENFILENAME Structure that exists in your main body, and is passed into your openfilename function. Without seeing the rest of your code I would say give that a shot.