|
-
April 12th, 2001, 02:53 PM
#1
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"
-
April 12th, 2001, 03:41 PM
#2
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
-
April 12th, 2001, 03:56 PM
#3
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.
-
April 12th, 2001, 03:59 PM
#4
Re: multimedia
Take App.Path out of the Quotes
App.Path & "\Filename"
-
April 12th, 2001, 05:42 PM
#5
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"
-
April 13th, 2001, 04:28 AM
#6
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.
-
April 16th, 2001, 07:25 AM
#7
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|