共用方式為


Setting the Error Log

 
Microsoft DirectShow 9.0

Setting the Error Log

After you implement the error logging class, create a new instance of the class. Then, give DES a pointer to it by calling the IAMSetErrorLog::put_ErrorLog method on the timeline. Query the timeline for the IAMSetErrorLog interface. To ensure that all errors are logged, you should call this method before you load, save, or render the timeline.

IAMSetErrorLog  *pSetLog = NULL;
IAMErrorLog     *pLog = new CErrReporter();

pTL->QueryInterface(IID_IAMSetErrorLog, (void **)&pSetLog);
pSetLog->put_ErrorLog(pLog);
pSetLog->Release();

Error logging has no effect on the return values that you receive when you call methods in your application. Error logging complements but does not replace the usual error handling techniques. To create a robust application, always check HRESULT values.