Solved

MCI Movie code needed

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

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

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

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…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…
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
Course of the Month5 days, 22 hours left to enroll

626 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