Template:AVO Sample of create and Initialize

From AVObjects Knowledge Base
(Difference between revisions)
Jump to: navigation, search
(Created page with "===Create and Initialize of Reader Object=== <source lang=cpp> //--------------------------------- // Create {{{1}}} object CComPtr<IAVObject>; spReader; HRESULT hr =...")
 

Revision as of 08:15, 11 July 2014

Create and Initialize of Reader Object

  //---------------------------------
  // Create {{{1}}} object
  CComPtr<IAVObject>;	spReader;
 
  HRESULT hr = Create_{{{1}}}(&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;
Personal tools