I have a problem since yesterday morning that's driving me crazy by now.
Problem is that I want to create a dialogue to browse for a folder. For every OS older than Vista I use the SHBrowseForFolder() method which is working fine (also for Vista and newer).
For Vista and newer I would like to use the IFileDialog because of performance, nicer GUI etc.
When I try to compile the implemented code for IFileDialog, I get the following "No GUID" error:
Code:
IFileDialog *pfd = NULL;
HRESULT hr = CoCreateInstance(CLSID_FileOpenDialog, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&pfd));
Error:
error C2787: 'IFileDialog' : no GUID has been associated with this object
In a conversation with my boss he told me that we cannot set the compiler flag to vista and above due to compatibility for XP. The problem was solved here with setting the compiler flag: How do I use iFileDialog in a VC++ 2010 project converted from VC++ 6.0?
Is it possible to use IFileDialog anyway? Maybe the class can be linked dynamically?
Could you please give me advice on how to implement? Thanks in advance.