Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Using multimedia files in VB 4

Posted on 1998-06-11
5
Medium Priority
?
356 Views
Last Modified: 2010-05-03
Hello everybody,
my goal is to start and stop MIDI-Music in the background and to start and stop AVI and MOV files by clicking a command button (not just by double clicking the video frame).
Who knows what to do in my case ?

Regards, Dr. Timo
0
Comment
Question by:Dr_Timo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 1

Expert Comment

by:cip
ID: 1463081
What version of visual basic? Try taking a look at the microsoft multimedia control.
0
 
LVL 1

Author Comment

by:Dr_Timo
ID: 1463082
It is Visual Basic Version 4.0. I did not know that it is so difficult to do this. Let's say I want to play MIDI music in the background which can be toggled on/off by Command-Buttons or within the program. And some actions or events should activate a video window to front an just play the movie (multimedia-integration). This must be possible in VB i hope.
0
 
LVL 1

Author Comment

by:Dr_Timo
ID: 1463083
It is Visual Basic Version 4.0. I did not know that it is so difficult to do this. Let's say I want to play MIDI music in the background which can be toggled on/off by Command-Buttons or within the program. And some actions or events should activate a video window to front an just play the movie (multimedia-integration). This must be possible in VB I hope.
0
 
LVL 1

Accepted Solution

by:
cip earned 400 total points
ID: 1463084
Dr_Timo,

Sure it is possibile.

Open VB, then from the menu "Tools", select "Custom controls".
From the available controls, select "Microsoft Multimedia control".
Then, draw a multimedia control on the form, together with three command buttons, name them cmdPlay, cmdStop and cmdRewind.
Paste this code in the Form_Load event and in the click events of the three buttons:

Private Sub Form_Load()
    ' Load a multimedia file into Microsoft
    ' multimedia control
    MMControl1.filename = "song.mid"
    ' Open the media, preparing to play
    MMControl1.Command = "Open"
End Sub

Private Sub cmdPlay_Click()
    ' Play media
    MMControl1.Command = "Play"
End Sub

Private Sub cmdStop_Click()
    ' Stop the media
    MMControl1.Command = "Stop"
End Sub

Private Sub cmdRewind_Click()
    ' First stop the media
    MMControl1.Command = "Stop"
   
    ' Then seek to position 0
    MMControl1.To = 0
    MMControl1.Command = "Seek"
End Sub

You can do exactly the same for a video file, simply substitute "song.mid" with the name of the video you want to play, or just use two different multimedia controls.

Cip.
0
 
LVL 1

Author Comment

by:Dr_Timo
ID: 1463085
Thank you very much, Cip! That does help me a lot !
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question