CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7

Thread: multimedia

  1. #1
    Join Date
    Nov 2000
    Location
    IL, U.S.A.
    Posts
    218

    multimedia

    I am trying to code my MCI multimedia control so it will play the file
    that is loaded in the same folder as my VB program. I want to be
    able to burn the program on to a disk and the file will play in my program.

    I can't use a path because my program will be graded on another computer.

    Here is the code that I am using:

    MMControl1.Notify = False
    MMControl1.Wait = True
    MMControl1.Shareable = False
    MMControl1.DeviceType = "AVIVideo"
    MMControl1.FileName = What code would go here to make this work the way I described?
    MMControl1.AutoEnable = True
    ' Open the MCI WaveAudio device.
    MMControl1.Command = "Open"
    'MMControl1.Command = "Play"


  2. #2
    Join Date
    Nov 2000
    Location
    Ohio
    Posts
    238

    Re: multimedia

    Try
    MMControl1.FileName = App.Path & "Filename.ext"

    App.Path returns the path where the executable resides... it doesnt matter if it is a cd-rom drive.. or someone elses computer

    P.S. you may want to check and make sure that the App.Path string is including the \ at the end of the path.

    I usually do this:

    Dim AppPath as string
    If Right(App.Path,1) = "\" then
    AppPath = App.Path
    Else
    AppPath = App.Path & "\"
    End If

    then use the string AppPath instead of App.Path
    Good Luck
    Joe

    P.S. if you get a good grade on this I want credit for it too
    lol





  3. #3
    Join Date
    Nov 2000
    Location
    IL, U.S.A.
    Posts
    218

    Re: multimedia

    Thanks Joe!!!!!!!!!!!!!!!!!!!
    I tried this before I posted the question.
    Dim dbName As String

    dbName = App.Path & "petra.avi"


    MMControl1.Notify = False
    MMControl1.Wait = True
    MMControl1.Shareable = False
    MMControl1.DeviceType = "AVIVideo"
    MMControl1.FileName = "App.Path & petra.avi"
    MMControl1.AutoEnable = True
    ' Open the MCI WaveAudio device.
    MMControl1.Command = "Open"

    I'll try what you said.


  4. #4
    Join Date
    Nov 2000
    Location
    Ohio
    Posts
    238

    Re: multimedia

    Take App.Path out of the Quotes
    App.Path & "\Filename"




  5. #5
    Join Date
    Nov 2000
    Location
    IL, U.S.A.
    Posts
    218

    Re: multimedia

    I am having the same problem with my Adodc control. I have this code and it does not work.

    Dim dbName As String

    dbName = App.Path & "\NameandPassords.mdb"
    adoNamesAndPasswordsDatabase.ConnectionString = App.Path & "\NameandPassords.mdb"


  6. #6
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Re: multimedia

    App.path will work, but it may give you a wrong path if you run your application via shortcuts and do not set the "Start in..." property of the shortcut to the effectively place where your exe is.
    Cesare Imperiali

    Special thanks to Lothar "the Great" Haensler. Come back soon, you Guru.
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

  7. #7
    Join Date
    Nov 2000
    Location
    Ohio
    Posts
    238

    Re: multimedia

    I would need to see more code..
    The code you posted doesnt DO anything.
    If you are having problems developing a connection string I would suggest using the Data Environment to connect to a database it will automatically create the connection string. You can then copy it and remove the data environment. And paste the connection string into your ADO code.

    Good luck
    Joe



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

Featured