Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

MCI Movie code needed

Posted on 1997-06-03
5
Medium Priority
?
212 Views
Last Modified: 2012-05-04
I recently uprgaded from vb3 to vb4 and don't know how to make the mci32.ocx access or show a movie file such as mmm or mov. Could someone please give me a simple code example on this please.
0
Comment
Question by:cross060397
  • 3
5 Comments
 

Author Comment

by:cross060397
ID: 1426775
Edited text of question
0
 

Expert Comment

by:Lucas041697
ID: 1426776
Example
The following example illustrates the procedure used to open an MCI device with a compatible data file. By placing this code in the Form_Load procedure, your application can use the multimedia MCI control “as is” to play, record, and rewind the multimedia file GONG.WAV. To try this example, first create a form with a multimedia MCI control.
 
Private Sub Form_Load ()
      ' Set properties needed by MCI to open.
      Form1.MMControl1.Notify = FALSE
      Form1.MMControl1.Wait = TRUE
      Form1.MMControl1.Shareable = FALSE
      Form1.MMControl1.DeviceType = "WaveAudio"
      Form1.MMControl1.FileName = "C:\WINDOWS\DING.WAV"

      ' Open the MCI WaveAudio device.
      Form1.MMControl1.Command = "Open"
End Sub

 
To properly manage multimedia resources, you should close those MCI devices that are open before exiting your application. You can place the following statement in the Form_Unload procedure to close an open MCI device before exiting from the form containing the multimedia MCI custom control.
 
Private Sub Form_Unload ()
      MMControl1.Command = "Close"
End Sub

----------------------------------------
DEVICETYPE PROPERTY
 
Description
Specifies the type of MCI device to open.
Syntax
[form.]MMControl.DeviceType[ = device$]
 
Remarks
The argument device$ is the type of MCI device to open: AVIVideo, CDAudio, DAT, DigitalVideo, MMMovie, Other, Overlay, Scanner, Sequencer, VCR, Videodisc, or WaveAudio.
The value of this property must be set when opening simple devices (such as an audio CD that does not use files). It must also be set when opening compound MCI devices when the file-name extension does not specify the device to use.

Data Type
String

0
 

Author Comment

by:cross060397
ID: 1426777
I found code to play wav files but I still haven't been shown the code for video files. Maybe I'm missing something but how do you get the video to show up? Is it a seperate form for that or what?
0
 

Author Comment

by:cross060397
ID: 1426778
I'm sorry Lucas, I did some playing around and got it to work using your code. Do you know how to make the video windows a child in a MDI form?
0
 
LVL 7

Accepted Solution

by:
tward earned 100 total points
ID: 1426779
Try the Following as this works for me with .AVI files, it should work with other video types also.

Hope this helps you!

  MMControl1.hWndDisplay = Form1.hWnd
  MMControl1.filename = "C:\DOS\TEMP\VCWELCOM.AVI"
  MMControl1.Command = "Open"
  MMControl1.Command = "Play"

0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

877 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