Click here to Skip to main content
15,920,217 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
On my desktop I have a system's variable name i.e. MYSTUFF, which points to C:\hippopotamus\in\diapers, but in my laptop MYSTUFF points to D:\hippopotamus\in\diapers. Having said that, when I compile I program on my desktop and then transfer it to my laptop, and visa versa, but the location of the stuff I need for my program, (i.e, images, sound files, etc.) is not even in the same hard drive. So the program needs to be recompiled.
I would like to compile in one machine and run it in the other one, not having to recompile.
I tried this, but to no avail:
C++
std::wstring myPath = L"std::wstring sound_file(L"%MYSTUFF%\\Sound\\Thunder.wav");";


What can I do to solve this problem?

Thanks
Posted
Comments
Sergey Alexandrovich Kryukov 4-Jun-15 17:35pm    
What do you mean by "system's variable"?
—SA
jeron1 4-Jun-15 17:39pm    
Do you mean environment variable?

1 solution

GetEnvironmentVariable [^]

but that's klunky - a more robust solution would be to set a registry entry with your destination, and read that
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900