-
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"
-
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
-
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.
-
Re: multimedia
Take App.Path out of the Quotes
App.Path & "\Filename"
-
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"
-
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.
-
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