user2608239
user2608239

Reputation: 11

CFileDialog support XP and Vista

my app supports XP and up, and I'm trying to use the CFileDialog newer interfaces (i.e. GetIFileOpenDialog()) when running under Vista and up (to respect the limitations of those interfaces).

So I check for the OS version, and try to use those interfaces if appropriate, and fall back on older methods for XP. The problem is that running under XP I get LoadLibrary failures (the code is in a DLL), so there seems to be some early binding going on. As soon as I comment out the code that uses those interfaces then the LoadLibrary succeeds.

Is it possible at all to have CFileDialog code using Vista features running under XP, even if the code is not called?

Thanks

Upvotes: 0

Views: 303

Answers (1)

Mats Petersson
Mats Petersson

Reputation: 129374

You will need to manually load the relevant library with LoadLibrary(), (it won't be loaded a second time, but you need a good handle for it) and then use GetProcAddress() to get the address of the function (GetIFileOpenDialog). If you just use the Vista function directly, it won't load on XP, since it does, as you say, bind the function directly.

Upvotes: 0

Related Questions