Jump to content
  • Advertisement
Sign in to follow this  
e64

Desktop Directory

This topic is 4237 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, Does anyone know how to get the desktop directory for the current user via win32? I tried this:
#include <windows.h>
#include <shlobj.h>
#include <stdio.h>

int main(int argc, char *argv[]) {
	char buf[4096];
	SHGetFolderPath(NULL,CSIDL_DESKTOPDIRECTORY,0,SHGFP_TYPE_CURRENT,buf);
	printf("directory: %s\n",buf);
	return 0;
}
But MSVC6 complains, 'SHGetFolderPath' : undeclared identifier. even though the MSDN claims the function is in shlobj.h (http://msdn.microsoft.com/library/en-us/shellcc/platform/shell/reference/functions/shgetfolderpath.asp?frame=true) Thanks.

Share this post


Link to post
Share on other sites
Advertisement
Before including windows.h you need to have

#define NTDDI_VERSION NTDDI_WIN2K

if using the most recent Platform SDK or

#define _WIN32_WINNT 0x0500

if using an older Platform SDK.

Share this post


Link to post
Share on other sites
<Obligatory MSVC6 Is Bad™ Post>

MSVC 6 Is Bad™ - MSVC 8 (2005) is freely available and is far superior in every way. MSVC 6 was produced before the C++ standard was finalized, so it's support for C++ is very poor and it's standard library is not at all conformant.

You would do yourself a great service to upgrade to the freely available version of MSVC 8.

Share this post


Link to post
Share on other sites
I realize that vc++6 is bad, but if you combine it with stlport, is it still as awful as it is made out to be? (we are a 7.1 shop ourselves)

Share this post


Link to post
Share on other sites
Quote:
Original post by metiscus
I realize that vc++6 is bad, but if you combine it with stlport, is it still as awful as it is made out to be? (we are a 7.1 shop ourselves)


It handles templates like a drunk man in a china shop. :)

Share this post


Link to post
Share on other sites
Quote:
Original post by metiscus
I realize that vc++6 is bad, but if you combine it with stlport, is it still as awful as it is made out to be? (we are a 7.1 shop ourselves)
Yes, it really is. The STL implementation is just one of the things that's screwed up with VC6. There's templates as dmail mentioned, the optimiser can generate broken code, the code it generates isn't nearly as optimal as VC2005 can generate, it's over 10 years old now, and there's a lot of SDKs that aren't supported with it (E.g. the DirectX SDKs from the last year and a half).

Share this post


Link to post
Share on other sites
Colin Jeanne: Thanks for the tip, got it working now!

Extrarius/vc6 debate:
Yes, I have VC6, VC7 (although not installed), VC7.1 and VC8, and I agree VC8 is a great compiler - a first for MS, and VS2005 is a great IDE.

That being said, I know the VC6 compiler fairly well, I never need to worry about manifest files and such nonsense, it produces smaller executables, the IDE uses only 8mb ram instead of >100, the interface is fast, basically, its awesome for small projects. (read: <3k LOC, single exe distributable)

If I'm doing anything bigger where I'm likely to consider doing something using advanced templates (vc6's template support isn't THAT broken), then I'll boot up VC8.

Share this post


Link to post
Share on other sites
I should mention, new versions of the Platform SDK dont support MSVC++ 6.0, if I recall correctly.

Further, you dont need to worry about manifest files, etc. unless you want to. Everything that you're doing now in 6.0 can be done in pretty much the exact same way in 8.0.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!