CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2001
    Posts
    8

    Problem opening avi file

    Hi all Gurus,

    Hope someone could assist:

    I have an animated gif which I would like to open in a vb form. The following 2 files were in the directory "c:\test" :
    1) animate.gif
    2) animate.avi

    In my new vb project, I have added the component "Microsoft Windows Common Controls 2 6.0" which is the c:\winnt\system32\mscomct2.ocx

    In my form1, I have added the new animation control name "animation1"

    These codes were added:

    Public Sub Form_load()
    animation1.open "c:\image\animate.avi"
    animation1.play
    end sub

    At run time, I got this error message:

    Run-Time error '35752'
    Unable to open avi file


    Could anyone please help. Thanks in advance


    Newbie







  2. #2
    Join Date
    Apr 2000
    Location
    South Carolina,USA
    Posts
    2,210

    Re: Problem opening avi file

    I have a sample program (Listed below) that does the same thing as you depict so maybe something is wrong with your file? Two Command buttons, (cmdPlay and cmdStop), a CommonDialog control (DlgOpen) + the Animation control (anmAVI) is all you need to run this sample, with some editing of the dlgOpen.InitDIr statement.

    private Sub cmdPlay_Click()
    ' Configure a CommonDialog control to allow the
    ' user to find .avi files to play. The CommonDialog
    ' control is named "dlgOpen." The Animation control
    ' is named "anmAVI."
    dlgOpen.Filter = "avi files (*.avi)|*.avi"
    dlgOpen.InitDir = "C:\Program Files\Microsoft Visual Studio\Common\Graphics\Videos"
    dlgOpen.ShowOpen
    anmAVI.Open dlgOpen.FileName
    anmAVI.Play
    End Sub

    'This code stops the video playing:

    private Sub cmdStop_Click()
    anmAVI.Stop
    End Sub





    John G

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured