Solved

MCI Movie code needed

Posted on 1997-06-03
5
196 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
[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
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
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…

734 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