Results 1 to 9 of 9

Thread: Files and VB

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jun 1999
    Posts
    25
    Can anyone help me with this:

    I have made a program, and if you drag the form elsewhere on the screen, a WAV file is played. For the WAV file I have to specify a certain address. Doing that, everything works. Lets say, my WAV file is located in, C:\Media\hello.wav, and my executable file is located in C:\VB\cool.exe.

    To play that file, I just enter that file path in my code to play it.

    Suppose, I was to give my program to someone else with all the necessary files in their corresponding folders.

    Suppose If the person moves my program in to the Program Files folder. By doing this the sound will not be played.

    I dont think I am making much sense inn explaining this, so let me try to go in further details:

    I have seen programs, which have WAV's playing in their application. No matter what folder i install the application to, the WAV will still play. That is, unless I change the wav files name itself. Make sense? This is what i think How u would do it, but apparently it doesnt work.

    \Media\hello.wav

    by doing this, i would think even if the user put the Media folder in Program Files, it would still play, but it doesnt! Please someoen HELP!

  2. #2
    Frenzied Member
    Join Date
    Aug 2000
    Posts
    1,539
    2 solutions

    1. put all files in one directory including wav and .exe
    and use App.Path object/property

    2. write ini files to keep track of their location, and when you run the app it checks if those files are located where the ini says so, if not force them to locate the files and rewrite ini's


    first solution is better

  3. #3
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Talking Maybe...

    Couldn't you have the Wav file install into the app directory?

    then use app.path & "sound.wav" ?

    Just a thought
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  4. #4
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Cool aaauuurrrggghh!

    Foiled again!

    I'll get you my pretty!




    Kovan
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  5. #5
    Frenzied Member
    Join Date
    Aug 2000
    Posts
    1,539
    you need something called SPEED my friend
    let see if can make it 3 times before i go home

  6. #6
    Frenzied Member
    Join Date
    Aug 2000
    Posts
    1,539
    or MABYE

    you wait for me to answer
    then you copy and paste my idea of solving the problem

    yep i think thats it
    hehe

  7. #7
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    hmmm

    I think I'll go with curtain 2...

    wait for you to answer...


    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  8. #8
    Guest

    Re: Maybe...

    Originally posted by geoff_xrx
    Couldn't you have the Wav file install into the app directory?

    then use app.path & "sound.wav" ?

    Just a thought
    This is a good thought. Except that it will not work.

    App.Path & "sound.wav" <-returns something like C:\MyProgsound.wav

    You have to add the \ in yourself or no sound will be played since the path is not correct.

    So it'd be like this:

    App.Path & "\sound.wav" <-returns something like C:\MyProg\sound.wav

  9. #9
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Talking oops...

    My master hath spoken....




    typo...Thanks Matthew


    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

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