Click to See Complete Forum and Search --> : multimedia
Drew
April 12th, 2001, 02:53 PM
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"
Joe Keller
April 12th, 2001, 03:41 PM
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
Drew
April 12th, 2001, 03:56 PM
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.
Joe Keller
April 12th, 2001, 03:59 PM
Take App.Path out of the Quotes
App.Path & "\Filename"
Drew
April 12th, 2001, 05:42 PM
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"
Cimperiali
April 13th, 2001, 04:28 AM
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.
Joe Keller
April 16th, 2001, 07:25 AM
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
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.