IWMEncBasicEdit::get_Profile
![]() |
The get_Profile method retrieves the profile used by the input file that is currently loaded.
Syntax
HRESULT get_Profile(
IWMEncProfile2** ppIWMEncProfile2
);
Parameters
ppIWMEncProfile2
[out] Pointer to a pointer to an IWMEncProfile or an IWMEncProfile2 interface containing the profile.
Return Values
If the method succeeds, it returns S_OK. If it fails, it supports the IErrorInfo interface and returns an HRESULT error code.
| Return code | Number | Description |
| E_POINTER | 0x80004003 | The indirect pointer to the profile is NULL. |
Example Code
// Include libraries.
#include <windows.h>
#include <atlbase.h>
#include <comdef.h>
#include "C:\WMSDK\WMEncSDK9\include\wmencode.h"
#include <conio.h> // for kbhit()
HRESULT hr;
IWMEncBasicEdit* pBasicEdit;
IWMEncProfile2* pPro;
WMENC_LONGLONG LMarkin, LMarkout;
// Initialize the COM library and retrieve a pointer to an IWMEncBasicEdit interface.
hr = CoInitialize(NULL);
if ( SUCCEEDED( hr ) )
{
hr = CoCreateInstance(CLSID_WMEncBasicEdit,
NULL,
CLSCTX_INPROC_SERVER,
IID_IWMEncBasicEdit,
(void**) &pBasicEdit);
}
// Specify the input and output files.
if ( SUCCEEDED( hr ) )
{
hr = pBasicEdit->put_MediaFile(CComBSTR("C:\\InputFile.wmv"));
}
if ( SUCCEEDED( hr ) )
{
hr = pBasicEdit->put_OutputFile(CComBSTR("C:\\OutputFile.wmv"));
}
// Specify a configuration file.
if ( SUCCEEDED( hr ) )
{
hr = pBasicEdit->put_ConfigFile(CComBSTR("C:\\ConfigFile.txt"));
}
// Add indexing to the file.
if ( SUCCEEDED( hr ) )
{
hr = pBasicEdit->put_Index(VARIANT_TRUE);
}
// Specify the mark-in and mark-out times.
LMarkin.int64 = 50000000; // 5 seconds
LMarkout.int64 = 250000000; // 25 seconds
if ( SUCCEEDED( hr ) )
{
hr = pBasicEdit->put_MarkIn(LMarkin);
}
if ( SUCCEEDED( hr ) )
{
hr = pBasicEdit->put_MarkOut(LMarkout);
}
// Retrieve the profile.
if ( SUCCEEDED( hr ) )
{
hr = pBasicEdit->get_Profile(&pPro);
}
// Start editing.
if ( SUCCEEDED( hr ) )
{
hr = pBasicEdit->Start();
}
// Leave the console window open until the process has finished.
printf("When editing stops, press a key to close the console window.");
// Wait for a key press.
while(!kbhit())
_asm nop;
// Release pointers.
if ( pPro )
{
pPro->Release();
pPro = NULL;
}
if ( pBasicEdit )
{
pBasicEdit->Release();
pBasicEdit = NULL;
}
Requirements
Header: wmencode.h
Library: wmenc.exe
See Also
.gif)