|
-
June 20th, 2015, 04:38 PM
#1
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?
-
June 21st, 2015, 02:45 AM
#2
Re: Getting IFileDialog to work in VC++ 2005
As stated in MSDN
Minimum supported client is Windows*Vista [desktop apps only]
See https://msdn.microsoft.com/en-us/lib...(v=vs.85).aspx
Victor Nijegorodov
-
June 21st, 2015, 03:13 AM
#3
Re: Getting IFileDialog to work in VC++ 2005
 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.
 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.
 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.
Last edited by ovidiucucu; June 21st, 2015 at 03:20 AM.
-
June 22nd, 2015, 08:56 AM
#4
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?
-
June 22nd, 2015, 10:53 AM
#5
Re: Getting IFileDialog to work in VC++ 2005
 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? ). 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.
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.
Last edited by Igor Vartanov; June 22nd, 2015 at 11:00 AM.
Best regards,
Igor
-
June 22nd, 2015, 11:03 AM
#6
Re: Getting IFileDialog to work in VC++ 2005
 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.
-
June 22nd, 2015, 11:32 AM
#7
Re: Getting IFileDialog to work in VC++ 2005
Okay, what you have is:
IFileDialog interface
Requirements Minimum supported client
|
Windows Vista [desktop apps only] |
| Minimum supported server |
Windows Server 2008 [desktop apps only] |
| Header |
Shobjidl.h |
| IDL |
Shobjidl.idl |
Best regards,
Igor
-
June 22nd, 2015, 12:37 PM
#8
Re: Getting IFileDialog to work in VC++ 2005
 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).
-
June 23rd, 2015, 05:39 PM
#9
Re: Getting IFileDialog to work in VC++ 2005
 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.
-
June 24th, 2015, 03:41 AM
#10
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.
All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!
C++23 Compiler: Microsoft VS2022 (17.6.5)
-
June 24th, 2015, 05:28 AM
#11
Re: Getting IFileDialog to work in VC++ 2005
 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!
 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.
Victor Nijegorodov
-
June 24th, 2015, 10:14 AM
#12
Re: Getting IFileDialog to work in VC++ 2005
 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
-
June 24th, 2015, 10:25 AM
#13
Re: Getting IFileDialog to work in VC++ 2005
 Originally Posted by OReubens
I'm pretty sure this function even existed back in Win95
Exactly! From my MSDN from october 2000:
Requirements
Version 4.00 and later of Shell32.dll
and Version 4.00 means:
Microsoft® Windows® 95/Windows NT® 4.0.
Victor Nijegorodov
-
June 25th, 2015, 03:07 PM
#14
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.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|