Click here to Skip to main content
15,899,935 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, I have spent some weeks now tying to get a teaching aid to run giving aid for children to learn English.
On my M/c it works fine, naturally as it use's VB files by default.
Now when it is on disk, loaded on a clean PC it loads fine and I can get it to react to some click commands. These are the unmoveable ones set in the layout. All sound files in SOUNDS and SoundsA folders are not found, also the GRAPHIC folder will not open to display the letters and pictures. Autorun starts up great, it's just not finding, therefore not opening the folders.
I am not a programmer by any stretch of the imagination and I first made these cd's in 1998 with VB5 then, you just copied to disk and am now a 74yr old Volunteer. I, along with the children, will be greatful to anyone who can help me solve this problem.
SmudgeXVI
Posted
Comments
Mehdi Gholam 1-Oct-11 9:35am    
Are you running on Windows 7 or an older windows?

1 solution

You should make sure any file path in your program is relative to where the applicaiton itself is ran from.

To do so, use
app.Path
which will return this path.
So if the applicaiton was ran from
VB
"c:\users\myname\documents\mywork\"
and the sound files were located in
VB
"c:\users\myname\documents\mywork\sounds"
, then if you run your applicaiton from a CD
VB
(D:\)
, app.Path will become
VB
"D:\"
and the sound files will be searched at
VB
"D:\sounds"
.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900