Results 1 to 6 of 6

Thread: Path problem

  1. #1
    Ragnar
    Guest

    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

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    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.

  3. #3
    Ragnar
    Guest
    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)

  4. #4
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    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.

  5. #5
    Ragnar
    Guest
    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

  6. #6
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    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
  •  



Click Here to Expand Forum to Full Width