Getting IFileDialog to work in VC++ 2005
I'm trying to get at these newer libraries that seem to be available as early as VC++ 2005, like IFileDialog. Unfortunately, even when I #include <Shobjidl.h>, I get told that IFileDialog isn't defined. I assume I don't have it yet. How do I get it?
Does it matter that I'm running WinXP?
Re: Getting IFileDialog to work in VC++ 2005
As stated in MSDN
Quote:
Minimum supported client is Windows*Vista [desktop apps only]
See https://msdn.microsoft.com/en-us/lib...(v=vs.85).aspx
Re: Getting IFileDialog to work in VC++ 2005
Quote:
Originally Posted by
DeptOfMeteors
I'm trying to get at these newer libraries that seem to be available as early as VC++ 2005, like IFileDialog. Unfortunately, even when I #include <Shobjidl.h>, I get told that IFileDialog isn't defined. I assume I don't have it yet.
Don't just assume, verify!
If cannot find IFileDialog in Shobjidl.h install a newer SDK.
Quote:
Originally Posted by DeptOfMeteors
How do I get it?
Pretty easy, from Microsoft Download Center: http://www.microsoft.com/en-us/downl....aspx?id=14477.
Quote:
Originally Posted by DeptOfMeteors
Does it matter that I'm running WinXP?
Yes, it does. IFileDialog is supported on Windows Vista/Server 2008 and newer systems (as already Victor pointed).
Click https://msdn.microsoft.com/en-us/lib...(v=vs.85).aspx and don't forget to read Requirements in the bottom of the page.
Re: Getting IFileDialog to work in VC++ 2005
So it sounds like what you're telling me is that I'm paralysed until I upgrade.
The reason I wanted that class is I want a directory browser, which the old CFileDialog didn't afford. Is there an alternative for XP?
Re: Getting IFileDialog to work in VC++ 2005
Quote:
Originally Posted by
DeptOfMeteors
So it sounds like what you're telling me is that I'm paralysed until I upgrade.
Not sure what you mean by "paralysed." The said functionality is implemented in Windows Vista+. So you can (most probably) program it in Windows XP alright, but you cannot test is there, as it just does not exist in XP (well, you cannot test daddy's Mersedes features while sitting in mom's Chevy, right? :D). A very common situation for supporting a family of OSs, I would say.
In case you're not willing to upgrade, you always can install another Windows version in a virtualization system like Virtual Box or VMware and test your app there. Afraid, you have to buy that other Windows version anyway because of legal matters, or maybe you download a test-purpose-only OS image from MS. Read the license terms to see if it allows what you want.
Quote:
The reason I wanted that class is I want a directory browser, which the old CFileDialog didn't afford. Is there an alternative for XP?
Can you imagine what installing a piece of Windows Vista into XP would look like? If you want to make use of Windows Vista function, you need Windows Vista or any other Windows version compatible with the function.
Re: Getting IFileDialog to work in VC++ 2005
Quote:
Originally Posted by
Igor Vartanov
Can you imagine what installing a piece of Windows Vista into XP would look like? If you want to make use of Windows Vista function, you need Windows Vista or any other Windows version compatible with the function.
All I'm imagining is code from an XP-compatible SDK that can browse directories in the same way I can already browse files. It's not hard to imagine Win3.11 having such a thing, but I'd settle for it realized in XP.
Re: Getting IFileDialog to work in VC++ 2005
Okay, what you have is:
IFileDialog interface
Quote:
Requirements Minimum supported client
|
Windows Vista [desktop apps only] |
| Minimum supported server |
Windows Server 2008 [desktop apps only] |
| Header |
Shobjidl.h |
| IDL |
Shobjidl.idl |
Re: Getting IFileDialog to work in VC++ 2005
Quote:
Originally Posted by
DeptOfMeteors
So it sounds like what you're telling me is that I'm paralysed until I upgrade.
The reason I wanted that class is I want a directory browser, which the old CFileDialog didn't afford. Is there an alternative for XP?
For a directory browse dialog, what you need is SHBrowseForFolder api (available in XP and newer).
Re: Getting IFileDialog to work in VC++ 2005
Quote:
Originally Posted by
Arjay
For a directory browse dialog, what you need is
SHBrowseForFolder api (available in XP and newer).
Ok, unfortunately, when I try that (after "#include <Shlobj.h>") it can't find that function. From there I installed the SDK given above, but it still doesn't work.
Re: Getting IFileDialog to work in VC++ 2005
What error are you receiving? Are you receiving a compile or link error? ShBrowseForFolder requires shell32.lib.
Re: Getting IFileDialog to work in VC++ 2005
Quote:
Originally Posted by
DeptOfMeteors
Ok, unfortunately, when I try that (after "#include <Shlobj.h>") it can't find that function.
Strange! I use SHBrowseForFolder since the Windows 98/NT and never had any problem!
Quote:
Originally Posted by
DeptOfMeteors
From there I installed the SDK given above, but it still doesn't work.
You don't need any additional SDK to use SHBrowseForFolder.
Re: Getting IFileDialog to work in VC++ 2005
Quote:
Originally Posted by
Arjay
For a directory browse dialog, what you need is
SHBrowseForFolder api (available in XP and newer).
I'm pretty sure this function even existed back in Win95
Re: Getting IFileDialog to work in VC++ 2005
Quote:
Originally Posted by
OReubens
I'm pretty sure this function even existed back in Win95
Exactly! From my MSDN from october 2000:
Quote:
Requirements
Version 4.00 and later of Shell32.dll
and Version 4.00 means:
Quote:
Microsoft® Windows® 95/Windows NT® 4.0.
Re: Getting IFileDialog to work in VC++ 2005
Oops! It looks like I spelled it wrong. It works now, thanks.
Although, now that I've started using it, I'm sort of wishing I hadn't figured it out.