Join 306,817 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,684 people online right now. Registration is fast and FREE... Join Now!
(Yeah, I pretty much just copy/pasted from MSDN .)
I'm using Code::Blocks on Vista, and I'd be grateful if anyone who's in the same boat would try to compile the code and let me know what errors (if any) they get.
My main question is this: is there a library i'm missing? I've included windows.h, but could one of the libraries it #include s be missing?
Note Starting with Windows Vista, the Common File Dialog has been superseded by the Common Item Dialog when used to open a file. We recommended that you use the Common Item Dialog API instead of the Common File Dialog API in this case. For more information, please see Common Item Dialog.
I would think that starting with Vista means that it will still work for XP. I've used the File Open Common Dialog Box from the Windows API on XP before. It wouldn't hurt to detect the Windows version in your code, that way assuring the API will work correctly.
I would think that starting with Vista means that it will still work for XP.
I sure hope so.
I like the version checking idea, but that only means it'll decide whether or not to execute the code. Although that may be helpful, my problem is with compiling, not executing.
Thanks for the help KYA/no2.
This post has been edited by lanec42: 22 Feb, 2009 - 07:05 PM
EDIT: Doesn't help. I was under the impression that windows.h included commdlg.h, though. MORE EDIT: I'm reading the common item dialog stuff. Once i get a good compile, i'll go try it on an XP box.
This post has been edited by lanec42: 22 Feb, 2009 - 07:09 PM
Sorry, i wasn't suggesting that. I was merely relating some information readily and easily available. Can you get the snippet I showed to compile on Vista? That's as small as you can get before adding other stuff.
D:\Users\lanec42\Desktop\Balance1\file.cpp||In function `void FileOpen(HWND__*)':| D:\Users\lanec42\Desktop\Balance1\file.cpp|8|error: `CLSID_FileOpenDialog' was not declared in this scope| D:\Users\lanec42\Desktop\Balance1\file.cpp|11|error: `IFileDialog' was not declared in this scope| D:\Users\lanec42\Desktop\Balance1\file.cpp|11|error: `pfd' was not declared in this scope| D:\Users\lanec42\Desktop\Balance1\file.cpp|11|error: `IID_PPV_ARG' was not declared in this scope| D:\Users\lanec42\Desktop\Balance1\file.cpp|21|error: `IShellItem' was not declared in this scope| D:\Users\lanec42\Desktop\Balance1\file.cpp|21|error: `psiResult' was not declared in this scope| D:\Users\lanec42\Desktop\Balance1\file.cpp|21|warning: unused variable 'IShellItem'| ||=== Build finished: 7 errors, 4 warnings ===|
Still not happening.
Where was "pfd" and "psiResult" declared, anyway? rawr m$.
EDIT: this "Minimum operating systems Windows Vista" was here. Will this be Vista-only if (ever) i get it working? That's what they seem to suggest...
This post has been edited by lanec42: 22 Feb, 2009 - 07:34 PM
If so, in the Project Options dialog box (Project->Project Options, or Alt+P), make sure in the Type group that Win32 GUI is selected, and not Win32 Console.
This post has been edited by bsaunders: 22 Feb, 2009 - 08:58 PM