views:

23

answers:

2

Hi,

I,m not c++ programmer on a daily basis, so I need help. I 'wrote' this. It's new project 'Windows Application' in DevC++. I add this

#include <Commctrl.h>
//...
HWND film;
//...
film = Animate_Create(hwnd, 10, WS_CHILD | WS_VISIBLE | ACS_AUTOPLAY, hThisInstance);

Animate_OpenEx(film, hThisInstance, "a.avi");

Animate_Play(film, 0, -1, 1);

Animate_Stop(film);

But it's not work. What is wrong? Window is open, but video not playing.

A: 

AVI is just a container format. You can't tell whats inside. So my guess would be that the actual data inside is not supported by the animation control. You could try playing "clock.avi" which should be in your windows folder (C:\Windows probably).

Also, be aware that the animation control does not work on Windows7. If you want sophisticated playback functionality, you can look at DirectShow. Animation controls are for very simple animations only.

"An animation control can display an AVI clip originating from either an uncompressed AVI file or from an AVI file that was compressed using run-length (BI_RLE8) encoding."

Details on the spec and supported data can be found here.

A: 

As Raymond Chen once blogged about, that animation control has many limitations. It was purposefully designed for only simple animations.

* The AVI must be non-interleaved.
* The AVI must have exactly one video stream.
* The AVI may not have an audio stream.
* The AVI may not use palette changes.
* The AVI must be either uncompressed or BI_RLE8-compressed. 

If any of these apply, you with either have to alter your AVI or use a different method to display it.

TheUndeadFish