How to Get the Apptdata path


need Get the apptdata path with this

1
2
3
4
5
6
7
8
 wchar_t *appdata  = 0;
if (S_OK == SHGetKnownFolderPath(FOLDERID_,
System,
Startup,
Windows, 
0,
 NULL,
 &appdata ) && appdata )
Last edited on
Spoons go in the spoon drawer, forks go in the fork drawer, and the Windows questions go in the Windows section of the forum. <- That was a reference to one of my favorite cartoons by the way, it wasn't necessarily me being snarky.

The function you want is "GetEnvironmentVariable()": http://msdn.microsoft.com/en-us/library/windows/desktop/ms683188(v=vs.85).aspx

It's pretty straight forward to use so just remember to include 'Windows.h'.
what the wrong here
get program path
"C:\Users\***\Desktop\Game_Source\Win32\Debug\Game.exe"

i need get apptdatepath

help me plz,
1
2
3
4
5
6
7
8
	wchar_t *szApptdataPath = 0;
			//TCHAR szPath[MAX_PATH];

if (S_OK == SHGetFolderPath(NULL, CSIDL_COMMON_APPDATA, NULL, 0, szApptdataPath))
			
			{
				std::wstring strCmdPromptPath = szApptdataPath;
				strCmdPromptPath += L"\\Notepad.TXT";


Instead of copypasting random code and trying random variations of code until something works, have you considered reading information that is written for you?

You made no attempt to comprehend what Computergeek told you, so why should I make any attempt to help you at all?
Topic archived. No new replies allowed.