WMEncProfile2.ValidateMode
![]() |
The ValidateMode property specifies and retrieves a Boolean value indicating whether profile settings are validated immediately as they are set.
Syntax
bool = WMEncProfile2.ValidateMode;
WMEncProfile2.ValidateMode = bool;
Parameters
This property takes no parameters.
Property Value
A Boolean that indicates whether to validate settings immediately.
Remarks
When the ValidateMode property is true, settings are validated immediately. For example, if you set the CompatibilityMode to support Windows Media version 8 and earlier, and then set the get_VBRMode method to peak VBR mode, an error is returned at that time.
You can also use the Validate method to verify that your configuration is correct, and to return a more specific error message for compatibility issues, as well as messages informing you when all required settings for a profile are not present. Errors are not returned until you call this method, which is useful when your application is UI-based and you do not want errors returned immediately.
Example Code
using WMEncoderLib;
try
{
// Create a WMEncProfile2 object.
WMEncProfile2 Pro;
Pro = new WMEncProfile2();
// Use immediate validation.
Pro.ValidateMode = true;
// Specify settings for the profile and add an audience.
Pro.CompatibilityMode = WMENC_PROFILE_COMPATIBILITY.WMENC_ENCODER_V8;
Pro.Name = "My Profile";
Pro.ContentType = 17;
Pro.AddAudience(512000);
// The following statement would result in an immediate error.
// Pro.VBRMode = WMENC_PROFILE_VBR_MODE.WMENC_PVM_PEAK;
}
catch (Exception e)
{
// TODO: Handle exceptions.
}
Requirements
Reference: Windows Media Encoder
Namespace: WMEncoderLib
Assembly: Interop.WMEncoderLib.dll
Library: WMEncoderLib.dll
See Also
.gif)