Method Init
From AVObjects Knowledge Base
(Difference between revisions)
Line 25: | Line 25: | ||
//--------------------------------- | //--------------------------------- | ||
// Query IAVProperties interface | // Query IAVProperties interface | ||
− | CComQIPtr& | + | CComQIPtr<IAVProperties> spProps(spReader); |
ATLASSERT(spProps != NULL); | ATLASSERT(spProps != NULL); | ||
Revision as of 13:41, 8 July 2014
This page is a copy of the original page on the AVObjects' web site and can also be viewed here.
Initializes the object's data, for objects - splitter or reader makes opening files and the initial parsing.
HRESULT Init()
Returns:
S_OK AVObject successfully initialized E_FAIL Source file not found or other failure.
Sample
//--------------------------------- // Create MXF Reader object CComPtr<IAVObject> spReader; HRESULT hr = Create_MXFReader(&spReader); if (hr != S_OK) return hr; //--------------------------------- // Query IAVProperties interface CComQIPtr<IAVProperties> spProps(spReader); ATLASSERT(spProps != NULL); //--------------------------------- // Set filename hr = spProps->PropsSet(L"source", L"file.mxf"); if(hr != S_OK) return hr; //--------------------------------- // Init Object hr = spReader->Init(); if(hr != S_OK) return hr;