Solved

CAnimateCtrl can't play AVI file properly

Posted on 2002-06-23
10
720 Views
Last Modified: 2013-11-20
Hi, i'm using the CAnimateCtrl to play a small AVI clip (no sound) in my Visual C++ software.. i have no problem with the few AVI clips i created earlier... but i just created another new AVI clips using ULead GIF animator but the software can't display/play it properly!
the video clip is distorted, blank or crash the system when it was played..
i've tried many of different settings when creating the avi file (256colour, 24 bit colour, different compression, different data type..
) but got no luck so far.. so can any tell me how to fix this problem??
or is there any other way i can play a short video clip easily in my VC++ software? (maybe mpeg, animated gif...etc?)
i need help urgently..thanks
0
Comment
Question by:rw8
  • 4
  • 4
10 Comments
 

Accepted Solution

by:
vpomona earned 100 total points
ID: 7104283
    /** Play an AVI **/
TCHAR szFile[] = "filename.avi";    
     HWND m_hMCI = MCIWndCreate(m_hWnd,AfxGetApp()->m_hInstance,WS_OVERLAPPED|MCIWNDF_NOPLAYBAR|MCIWNDF_NOMENU, NULL);

if (MCIWndOpen(m_hMCI,szFile, 0) != 0)
{
     MessageBox("Unable to play AVI!","Error!");
      MCIWndDestroy(m_hMCI);
}

     MCIWndPlay(m_hMCI);
0
 

Author Comment

by:rw8
ID: 7105945
Thanks it works great.. but can you tell me how to make it "auto repeat"??
i tried to use the "mciSendCommand" but couldn't figure out how to do that
0
 

Expert Comment

by:vpomona
ID: 7106392
MCIWndSetRepeat( m_hMCI,true);
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:rw8
ID: 7106399
hm i'm afriad it doesn't work, according to MSDN it says:
The MCIWndSetRepeat macro only affects playback that the user initiates by hitting the play button on the toolbar. It will not affect playback started with the MCIWndPlay macro

so any other solution?
0
 

Expert Comment

by:vpomona
ID: 7108213
Here's a link to the site that helped me.  Hope it helps you too.
Good Luck!

http://www.geocities.com/contactgirish/Miscellaneous1.html
0
 

Author Comment

by:rw8
ID: 7109235
Sorry but i still can't figure out how to auto repeat the video clip.. anyone else can help??
0
 

Expert Comment

by:vpomona
ID: 7109303
So is this a new question?
0
 

Author Comment

by:rw8
ID: 7109315
No this is not.. cos when i was using CAnimateCtrl, i was using the "Auto Repeat" function and i was able to do that easily.. so if i have to use something other thatn CAnimateCtrl, i would need a way to do it as well or it will be no use for me.

cheers,
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone 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

Suggested Solutions

Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

792 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