IWMEncBasicEdit::put_OutputFile
![]() |
The put_OutputFile method specifies the name of the output file.
Syntax
HRESULT put_OutputFile(
BSTR bstrOutputFileName
);
Parameters
bstrOutputFileName
[in] BSTR specifying the output file name and path.
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 |
| NS_E_INVALID_REQUEST | 0xC00D002BL | The request is invalid while the editing process is running. |
Remarks
Use the put_OutputFile method to specify the file to contain the result of the basic edit process. If an output file is not specified, the input file is modified.
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;
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);
}
// 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 ( pBasicEdit )
{
pBasicEdit->Release();
pBasicEdit = NULL;
}
Requirements
Header: wmencode.h
Library: wmenc.exe
See Also
.gif)