Displaying Property Pages
Top  Previous  Next

ActiveUSB Video Capture Filter provides a pass-through access to ActiveUSB Property Pages. The filter and its output pin expose ISpecifyPropertyPages interface for retrieving a list of CLSIDs which may then be passed to the OLECreatePropertyFrame API function for display and control. The following code shows how to display the filter's property pages:


//get the property page interface
ISpecifyPropertyPages *pProp;
HRESULT hr = pFilter->QueryInterface(IID_ISpecifyPropertyPages, (void **)&pProp);

//get the filter's name and Unknown pointer
if (SUCCEEDED(hr))
{
IUnknown *pFilterUnk;
pFilter->QueryInterface(IID_IUnknown, (void **)&pFilterUnk);

//show the property pages
CAUUID caGUID;
pProp->GetPages(&caGUID);
pProp->Release();
OleCreatePropertyFrame(
hwnd,            
// parent window handle
0, 0, NULL,          
// caption for the dialog box
1,             
// number of objects
&pFilterUnk,          
// array of object pointers
caGUID.cElems,       
// number of property pages
caGUID.pElems,    
   // array of property pages CLSIDs
0, 0, NULL
);

//release objects
pFilterUnk->Release();
CoTaskMemFree(caGUID.pElems);
}

For an example on how to display the pin's property pages refer to ISpecifyPropertyPages.

The filter's property pages provides an access to those camera properties that can be modified while the graph is running, while the pin's property pages control the camera settings that cannot be accepted dynamically such as video mode and format change. Therefore you must stop the graph before displaying the pin's property pages and rebuild it afterwards.