ATLMovie Attributes Sample: Uses Compiler COM Support and Active Movie Interfaces in an ATL Control
Collapse the table of content
Expand the table of content
The document is archived and information here might be outdated

ATLMovie Attributes Sample: Uses Compiler COM Support and Active Movie Interfaces in an ATL Control 

Download sample

The ATLMovie attributes sample is an ATL control that demonstrates how to use compiler COM support and the Active Movie interfaces to play a movie. It implements several COM properties and methods on its IMovieCtl interface.

Security noteSecurity Note

This sample code is provided to illustrate a concept and should not be used in applications or Web sites, as it may not illustrate the safest coding practices. Microsoft assumes no liability for incidental or consequential damages should the sample code be used for purposes other than as intended.

Building and Running the Sample

To build and run this sample

  1. Open the solution file ATLMovie.sln.

  2. From the Build menu, click Build.

  3. After the sample builds, open MovieCtl.htm in your Web browser. This will play the clock.avi file, which ships with Windows.

    You may need to edit MovieCtl.htm and update the line:

    MovieCtl.FileName = "C:\Winnt\Clock.AVI"

    to point to the location of the Clock.AVI file on your particular system.

Properties and Methods

Name Description


The file name of the movie to play.

Name Description


Pause the currently playing movie.


Play the movie pointed to by the FileName property.


Reset the playing position to the beginning of the movie.


Stop the movie.


This sample uses the following attributes:

coclass, dual, emitidl, helpstring, id, in, module, object, oleautomation, pointer_default, progid, propput, registration_script, threading, uuid


This sample uses the following keywords:

BEGIN_COM_MAP; BEGIN_MSG_MAP; BEGIN_OBJECT_MAP; BEGIN_PROPERTY_MAP; CComCoClass; CComControl; CComModule::GetClassObject; CComModule::GetLockCount; CComModule::Init; CComModule::RegisterServer; CComModule::Term; CComModule::UnregisterServer; CComObjectRootEx; COM_INTERFACE_ENTRY; COM_INTERFACE_ENTRY_IMPL; COM_INTERFACE_ENTRY_IMPL_IID; CreateBrushIndirect; CreateFilterGraph; CWindow::GetDC; DECLARE_REGISTRY_RESOURCEID; DeleteObject; DisableThreadLibraryCalls; END_COM_MAP; END_MSG_MAP; END_OBJECT_MAP; END_PROPERTY_MAP; FillRect; GetProperty; IDispatchImpl; IMediaControlPtr::Pause; IMediaControlPtr::Release; IMediaControlPtr::RenderFile; IMediaControlPtr::Run; IMediaControlPtr::Stop; IMediaPositionPtr::CurrentPosition; IMediaPositionPtr::Duration; IObjectSafetyImpl; IOleControlImpl; IOleInPlaceActiveObjectImpl; IOleInPlaceObjectWindowlessImpl; IOleInPlaceObjectWindowlessImpl::SetObjectRects; IOleObjectImpl; IPersistStorageImpl; IPersistStreamInitImpl; IProvideClassInfo2Impl; IVideoWindowPtr ::Owner IVideoWindowPtr::.CreateInstance; IVideoWindowPtr::Owner ; IVideoWindowPtr::SetWindowPosition; IVideoWindowPtr::Visible ; IVideoWindowPtr::WindowStyle ; IViewObjectExImpl; MESSAGE_HANDLER; OBJECT_ENTRY; OffsetRect; OleTranslateColor; Reset; SetWindowPosition; SysFreeString


Some of the samples, such as this one, have not been modified to reflect the changes in the Visual C++ wizards, libraries, and compiler, but still demonstrate how to complete your desired task.

See Also

Other Resources

ATL Attributes Samples

© 2016 Microsoft