Открытие файла AVI
В следующем примере выполняется инициализация библиотеки AVIFile с помощью функции AVIFileInit и открытие AVI-файла с помощью функции AVIFileOpen . Функция использует обработчик файлов по умолчанию.
// LoadAVIFile - loads AVIFile and opens an AVI file.
//
// szfile - filename
// hwnd - window handle
//
VOID LoadAVIFile(LPCSTR szFile, HWND hwnd)
{
LONG hr;
PAVIFILE pfile;
AVIFileInit(); // opens AVIFile library
hr = AVIFileOpen(&pfile, szFile, OF_SHARE_DENY_WRITE, 0L);
if (hr != 0){
// Handle failure.
return;
}
//
// Place functions here that interact with the open file.
//
AVIFileRelease(pfile); // closes the file
AVIFileExit(); // releases AVIFile library
}