-
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
-
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")
-
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
-
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?