C
Chris Richards
I am working with the Windows Media Encoder SDK, and at one point in the
code, I have a need to display the Property Page of a Device plugin. The
only code I have for doing this is written in C++ and looks like this:
// Retrieve the plug-in object.
if ( SUCCEEDED( hr ) )
{
hr = pVidSrc->GetSourcePlugin( &pPlugin );
}
// Call QueryInterface to verify whether the plug-in supports
// property pages. If it does, retrieve a pointer to the
// ISpecifyPropertyPages interface, and fill an array of GUID
// values in which each GUID specifies the CLSID of each property
// page that can be displayed for this object.
if ( SUCCEEDED( hr ) )
{
hr = pPlugin->QueryInterface(IID_ISpecifyPropertyPages,
(LPVOID*)&pPages);
}
if ( SUCCEEDED( hr ) )
{
hr = pPages->GetPages( &uuid );
}
// Invoke a dialog box to display.
if ( SUCCEEDED( hr ) )
{
hr = OleCreatePropertyFrame
(
m_hWnd, // You must create the parent window.
200, // Horizontal position for the dialog box.
200, // Vertical position for the dialog box.
CComBSTR("name"), // String used for the dialog box
caption.
1, // Number of pointers passed in pPlugin.
&pPlugin, // Pointer to the plug-in.
uuid.cElems, // Number of property pages.
uuid.pElems, // Array of property page CLSIDs.
LOCALE_USER_DEFAULT, // Locale ID for the dialog box.
0, // Reserved.
NULL // Reserved.
);
}
// Release memory.
if ( uuid.pElems )
{
CoTaskMemFree( uuid.pElems );
}
How do I achieve this same functionality in C#? CAN I do this in C#?
Thanks in advance for any replies.
code, I have a need to display the Property Page of a Device plugin. The
only code I have for doing this is written in C++ and looks like this:
// Retrieve the plug-in object.
if ( SUCCEEDED( hr ) )
{
hr = pVidSrc->GetSourcePlugin( &pPlugin );
}
// Call QueryInterface to verify whether the plug-in supports
// property pages. If it does, retrieve a pointer to the
// ISpecifyPropertyPages interface, and fill an array of GUID
// values in which each GUID specifies the CLSID of each property
// page that can be displayed for this object.
if ( SUCCEEDED( hr ) )
{
hr = pPlugin->QueryInterface(IID_ISpecifyPropertyPages,
(LPVOID*)&pPages);
}
if ( SUCCEEDED( hr ) )
{
hr = pPages->GetPages( &uuid );
}
// Invoke a dialog box to display.
if ( SUCCEEDED( hr ) )
{
hr = OleCreatePropertyFrame
(
m_hWnd, // You must create the parent window.
200, // Horizontal position for the dialog box.
200, // Vertical position for the dialog box.
CComBSTR("name"), // String used for the dialog box
caption.
1, // Number of pointers passed in pPlugin.
&pPlugin, // Pointer to the plug-in.
uuid.cElems, // Number of property pages.
uuid.pElems, // Array of property page CLSIDs.
LOCALE_USER_DEFAULT, // Locale ID for the dialog box.
0, // Reserved.
NULL // Reserved.
);
}
// Release memory.
if ( uuid.pElems )
{
CoTaskMemFree( uuid.pElems );
}
How do I achieve this same functionality in C#? CAN I do this in C#?
Thanks in advance for any replies.