Solved

MCI Movie code needed

Posted on 1997-06-03
5
181 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 50 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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Suggested Solutions

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

810 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