开发者

Why there are so many ways to get the filter graph manager in directshow?

Way 1:

HRESULT hr = CoCreateInstance(CLSID_FilterGraph, NULL, 
    CLSCTX_INPROC_SERVER,IID_PPV_ARGS(&pGraph));

Way 2:

开发者_如何学Python
hr = CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER, 
                    IID_IGraphBuilder, (void **)&pGraph);

What's the difference, why ?


IID_PPV_ARGS Macro

Used to retrieve an interface pointer, supplying the IID value of the requested interface automatically based on the type of the interface pointer used. This avoids a common coding error by checking the type of the value passed at compile time.

MSDN link

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜