|
-
Aug 3rd, 2002, 05:53 AM
#1
Thread Starter
Hyperactive Member
Strange Error
Hi,
I burnt my application on CD with necessary sound and image files. Which is not running from CD ROM, but if the same application, I copy down to my Hard Disk , it runs perfectly,
While running from CD ROM it gives me run time error "path not found" for images, though the error specified images are present on right path, and I have use app.path correctly....
I am just fade up ...
Please help me ASAP
Regards
Gary
-
Aug 3rd, 2002, 09:05 AM
#2
Fanatic Member
Did you make sure and include a backslash ("\") after app.path?
Something like this:
VB Code:
MyPath = App.Path & "\Img\Img1.bmp"
www.RealisticGraphics.net
Running VS.Net Enterprise & VB 6
Other Languages: JavaScript, VBScript, VBA, HTML, CSS, ASP, SQL, XML
MSN Messenger: kmsheff
-
Aug 3rd, 2002, 01:14 PM
#3
Stuck in the 80s
Originally posted by RealisticGraphics
Did you make sure and include a backslash ("\") after app.path?
It wouldn't matter since it works on his computer.
Last edited by The Hobo; Aug 3rd, 2002 at 01:54 PM.
-
Aug 3rd, 2002, 01:36 PM
#4
Need-a-life Member
To complete the idea....
If you run this code from a CD (let's say the D: drive)
VB Code:
App.Path & "\Img\Img1.bmp"
you will get "D:\\Img\Img1.bmp"
Emiliano F. Martín
If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
Encourage the person who helped you to keep doing it, and give him the points he deserves.
MP3 Organizer: Freeware to logically organize all your MP3s.
-
Aug 3rd, 2002, 01:39 PM
#5
Need-a-life Member
So, you should use something like:
VB Code:
Public Function AppPath () As String
AppPath = App.Path & Iif(Right(App.Path, 1) = "\", "", "\")
End Function
Usage:
Emiliano F. Martín
If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
Encourage the person who helped you to keep doing it, and give him the points he deserves.
MP3 Organizer: Freeware to logically organize all your MP3s.
-
Aug 3rd, 2002, 01:55 PM
#6
Stuck in the 80s
Re: To complete the idea....
Originally posted by Mc Brain
If you run this code from a CD (let's say the D: drive)
VB Code:
App.Path & "\Img\Img1.bmp"
you will get "D:\\Img\Img1.bmp"
Why does it do it like that with a CD Drive but not a fixed drive?
-
Aug 3rd, 2002, 02:00 PM
#7
-
Aug 3rd, 2002, 02:13 PM
#8
Stuck in the 80s
VB Code:
Private Sub Form_Load()
MsgBox App.Path
End Sub
Gives me "C:\Program Files\Microsoft Visual Studio\VB98"
I saved the project too, even compiled it and ran it. That's what I got.
-
Aug 3rd, 2002, 02:14 PM
#9
Stuck in the 80s
Wait, root of my hard dive. Yeah, it gives "C:\"
but if it's every any folder it doesn't give "\"
I see what you mean now. Okay
-
Aug 3rd, 2002, 09:09 PM
#10
Fanatic Member
HOBO: Good point. I missed the fact that it was working on his computer.
Mc Brain: Interesting. I didn't realize it would do that on the root drive. Anyway, to get around the problem I always use the following function... Similar to yours but works with any directory I pass.
VB Code:
Public Function CheckDir(ByVal Expression As String, Optional ByVal RemoveDir As Boolean = False) As String
If Len(Expression) <> 0 Then
If RemoveDir = False Then
CheckDir = IIf(Right(Expression, 1) = "\", Expression, Expression & "\")
Else
CheckDir = IIf(Right(Expression, 1) = "\", Left(Expression, Len(Expression) - 1), Expression)
End If
End If
End Function
www.RealisticGraphics.net
Running VS.Net Enterprise & VB 6
Other Languages: JavaScript, VBScript, VBA, HTML, CSS, ASP, SQL, XML
MSN Messenger: kmsheff
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|