How to get a native QuickTime movie object from the QuickTime ActiveX/COM control

Q: I'm working with the QuickTime ActiveX/COM control in my C++ application, and I'd also like to be able to call QuickTime Movie Toolbox functions using the C/C++ API . Can I get a native QuickTime movie object from the QuickTime ActiveX/COM control?

A: Yes. The QuickTime COM interface IQTControl and IQTMovie expose the methods get_Movie and get_MovieHandle, which you can use to get the native QuickTime movie (the traditional QTML handle). Once you have the native QuickTime movie, you can use it to call the QuickTime C/C++ APIs.

Here's a sample function:

Listing 1: How to get the native QuickTime movie from the QuickTime ActiveX/COM.


// Get the native QuickTime movie

void MyMovieClass::GetNativeQTMovie(long* outMovie)
{
    CComPtr<IQTControl> spQTControl;

    *outMovie=NULL;

    // Get interface pointer to control
    if (SUCCEEDED( m_ax.QueryControl(&spQTControl) ))
    {
        CComPtr<IQTMovie> spQTMovie;

        // Get interface pointer to movie
        spQTControl->get_Movie(&spQTMovie);
        if (spQTMovie)
        {
            // get the native QuickTime movie
            spQTMovie->get_MovieHandle((long*) outMovie);
        }
    }

    return;
}

Document Revision History

DateNotes
2008-03-27First Version

Posted: 2008-03-27


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.