Results 1 to 4 of 4

Thread: What's Going On? Please...

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Location
    West Florida
    Posts
    6
    I hope someone can help me with this. I am a beginner with VB6. Teaching myself!
    I made a little slide show program. I managed to get it packaged, and of off it went as a ZIP file. Sent it to my friend as a test. Errors kept coming up that the picture and sound files could not be found.
    I then unziped the program on my machine, and ran that from the start menu. Works fine. All my files are there under C:\Program Files\Project1. But the program defaults to looking for the files in their previous locations. It's like the file was never really compiled at all!
    (This is the second time for all of this. When I recompiled, I tried to make sure I was including all the files.)

    Thanks,

    Richard

  2. #2
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Location
    Red Wing, MN, USA
    Posts
    2,177
    When loading files from the Physical drive use a Relative path, i.e. the App.Path property which returns the location from which the Application was launched. Then when distributing your App make sure you store any other files (images/sounds) within the same folder as the EXE or a subfolder within that. Then you can use the App.Path property in your application, i.e.
    Code:
    Picture1 = LoadPicture(App.Path & "\GFX\Image1.bmp")

  3. #3
    Addicted Member S@NSIS's Avatar
    Join Date
    Aug 2000
    Location
    Stoke-On-Trent, England
    Posts
    243
    Hi,
    Instead of using absolute pathnames for your files (ie: C:\Program Files\MySound.wav) try using App.path and then call your files with: app.path & "\MySound.wav". Then when you compile your project with the P&D wizard (which I assume you are using), make sure that the files you want are installed into the same directory as your app.(there is options on the wizard to do this this, just can't remmeber exactly what they are!) and your program should have no trouble finding the files no matter where your friend installs it!

    Hope this sort of helps!

    Shaun



    Web/Application Developer
    VB6 Ent (SP5), Win 2000,SQL Server 2000

  4. #4
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431
    It would help if you posted your code that looks for the files.

    When you look for the files do you hard-code a location like

    MyFilePath = "C:\AFolder\MyFile"

    or do you use App.Path like

    MyFilePath = App.Path & "\" & "MyFile"

    If you file locations are not in your application path, do you specify where they go in the Setup or P&D Wizard?

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