Results 1 to 16 of 16

Thread: Strange Problem I have when I run Program???

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2002
    Posts
    72
    The following is a sample of the command that I used

    -----------------
    Private Sub Bashe1_Click()
    Picture1.Visible = True
    MediaPlayer1.Visible = True
    MediaPlayer1.open App.Path & "\audio\Aa\Bashe.wma"
    End Sub
    ------------------

  2. #2

    Thread Starter
    Lively Member
    Join Date
    Jan 2002
    Posts
    72
    The following is a sample of the command that I used

    -----------------
    Private Sub Bashe1_Click()
    Picture1.Visible = True
    MediaPlayer1.Visible = True
    MediaPlayer1.open App.Path & "\audio\Aa\Bashe.wma"
    End Sub
    ------------------

  3. #3
    PowerPoster
    Join Date
    Jun 2001
    Location
    Trafalgar, IN
    Posts
    4,141
    I would try switching the sub to something like this.
    VB Code:
    1. Private Sub Bashe1_Click()
    2. Dim strFilePath As String
    3.  
    4.     If Right(App.Path, 1) = "\" Then
    5.         strFilePath = App.Path
    6.     Else
    7.         strFilePath = App.Path & "\"
    8.     End If
    9.    
    10.     Picture1.Visible = True
    11.     MediaPlayer1.Visible = True
    12.     MediaPlayer1.open strFilePath & "audio\Aa\Bashe.wma"
    13. End Sub

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Jan 2002
    Posts
    72
    Thank you for your help...
    Your code gives an a compile error "Expected arry"

  5. #5
    PowerPoster
    Join Date
    Jun 2001
    Location
    Trafalgar, IN
    Posts
    4,141
    On what line?

  6. #6
    Hyperactive Member
    Join Date
    Apr 2002
    Location
    Toronto, Ontario
    Posts
    280
    Originally posted by sanfoor200

    Your code gives an a compile error "Expected arry"
    "Expected arry"?

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Jan 2002
    Posts
    72
    It gives the error in the following line


    If Right(App.Path, 1) = "\" Then

  8. #8
    PowerPoster
    Join Date
    Jun 2001
    Location
    Trafalgar, IN
    Posts
    4,141
    I'm clueless. I don't see why that would be throwing an error.

  9. #9
    Addicted Member
    Join Date
    Nov 1999
    Location
    Lost
    Posts
    216
    Hi sanfoor200

    Which version of vb are you using ??

  10. #10

    Thread Starter
    Lively Member
    Join Date
    Jan 2002
    Posts
    72
    VB 6.0

  11. #11
    C# Aficionado Lord_Rat's Avatar
    Join Date
    Sep 2001
    Location
    Cave
    Posts
    2,497
    When the program breaks, go to the IMMEDIATE window and type in

    ? App.Path

    What does it output?
    Need to re-register ASP.NET?
    C:\WINNT\Microsoft.NET\Framework\v#VERSIONNUMBER#\aspnet_regiis -i

    (Edit #VERSIONNUMBER# as needed - do a DIR if you don't know)

  12. #12

    Thread Starter
    Lively Member
    Join Date
    Jan 2002
    Posts
    72
    Lord_Rat :
    I'm talking about the compiled program....the project works fine before and after the compile when I run it from the HardDisk...but the problem is when I burn it on the CD...it gives me the error..

  13. #13
    vbCowboy
    Guest
    Try adding a command button to your main form and on the click event put a message box that displays App.Path. VB sometimes uses UNC addressing instead of drive letters. It also may not recognize the CD drive letter... Give it a try.

  14. #14

    Thread Starter
    Lively Member
    Join Date
    Jan 2002
    Posts
    72
    I did it .. it recognize the CD drive...but it looks it does not recognize the sub-firectories or folders where wave files are located? It recongizes the them when I run the program from the HardDisk... strange !!!

  15. #15
    Frenzied Member ae_jester's Avatar
    Join Date
    Jun 2001
    Location
    Kitchener Ontario Canada Earth
    Posts
    1,545
    When you run the program from the ROOT directory either C:\ D:\ or whateve, app.path returns [DriveLetter]:\..............if you run your program from a directory inside the root say for example c:\Temp....app.path does not return the slash at the end

    thats why it dont work

  16. #16

    Thread Starter
    Lively Member
    Join Date
    Jan 2002
    Posts
    72
    Thats right...it retains the name of directory without the slash at the end... like c:\bashes ... how I can overcome this problem ?

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