-
Path problem
Hi.
I'm trying to load a wav file that's not in the same directory as the exe. The wav file is in the dir "Sounds". I can't load it from that directory, i'm only getting it to work if the wav file is in the same directory as the exe.
Load_WAV("TEST.WAV");
That works if the wav is in the same dir as the exe but how do I write if I want to load it from the dir "Sounds" (without the quotes)? I've tried many combinations but I just can't get it to work.
Thx
Ragnar
-
Load_WAV("C:\\YourApps\\ThisApp\\Sound\\music.wav");
The double backslashes are important.
-
Thanks for your answer.
But if I give the program to another person he has to have the sounds in that directory. Can't it work without "c:\" etc? Just "Sounds\\test.wav" or something like that? (I tried that one btw)
-
Yes it should work that way. Do you use VC++ and start the app directly with Ctrl+F5?
-
I use Visual C++ but I've never used ctrl+f5. I tried to write Load_WAV("Sounds\\test.wav");
but it didn't work... hmm strange
-
Well, whatever...
When executing an application from within VC++ it's working directory is not the same as if you call the exe directly from explorer. In the first case, it is the project root folder, in the second it is the folder where your exe resides in (probably \debug)