|
-
Dec 10th, 2001, 09:39 AM
#1
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
-
Dec 10th, 2001, 10:50 AM
#2
Load_WAV("C:\\YourApps\\ThisApp\\Sound\\music.wav");
The double backslashes are important.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Dec 10th, 2001, 11:06 AM
#3
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)
-
Dec 10th, 2001, 11:08 AM
#4
Yes it should work that way. Do you use VC++ and start the app directly with Ctrl+F5?
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Dec 10th, 2001, 11:35 AM
#5
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
-
Dec 10th, 2001, 01:08 PM
#6
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)
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|