本文整理汇总了C++中MediaInfo::Open_Buffer_Continue_GoTo_Get方法的典型用法代码示例。如果您正苦于以下问题:C++ MediaInfo::Open_Buffer_Continue_GoTo_Get方法的具体用法?C++ MediaInfo::Open_Buffer_Continue_GoTo_Get怎么用?C++ MediaInfo::Open_Buffer_Continue_GoTo_Get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MediaInfo
的用法示例。
在下文中一共展示了MediaInfo::Open_Buffer_Continue_GoTo_Get方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FillTree
HRESULT MediaInfoWindow::FillTree(HWND root, const wchar_t *filename)
{
HTREEITEM file = InsertTreeviewItem(root, filename, TVI_ROOT);
InsertTreeviewItem(root, C(L"Reading Infomation ...."), file);
SendMessage(root, TVM_EXPAND, TVE_EXPAND, (LPARAM)file);
DoEvents();
MediaInfo MI;
// language
wchar_t path[MAX_PATH];
wcscpy(path, g_apppath);
wcscat(path, C(L"MediaInfoLanguageFile"));
FILE *f = _wfopen(path, L"rb");
if (f)
{
wchar_t lang[102400] = L"";
char tmp[1024];
wchar_t tmp2[1024];
USES_CONVERSION;
while (fscanf(f, "%s", tmp, 1024, f) != EOF)
{
MultiByteToWideChar(CP_UTF8, 0, tmp, 1024, tmp2, 1024);
if (wcsstr(tmp2, L";"))
{
wcscat(lang, tmp2);
wcscat(lang, L"\n");
}
}
fclose(f);
MI.Option(_T("Language"), W2T(lang));
}
else
{
MI.Option(_T("Language"));
}
HANDLE h_file = CreateFileW (filename, GENERIC_READ, FILE_SHARE_DELETE|FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL);
String str = L"";
if (h_file != INVALID_HANDLE_VALUE)
{
__int64 filesize = 0;
GetFileSizeEx(h_file, (LARGE_INTEGER*)&filesize);
DWORD From_Buffer_Size = 0;
unsigned char From_Buffer[1316];
MI.Open_Buffer_Init(filesize);
__int64 last_seek_target, seek_target = -5;
do
{
if (seek_target >= 0)
last_seek_target = seek_target;
if (!ReadFile(h_file, From_Buffer, 1316, &From_Buffer_Size, NULL) || From_Buffer_Size <= 0)
break;
size_t result = MI.Open_Buffer_Continue(From_Buffer, From_Buffer_Size);
if ((result&0x08)==0x08) // 8 = all done
break;
seek_target = MI.Open_Buffer_Continue_GoTo_Get();
if (seek_target>=0)
SetFilePointerEx(h_file, *(LARGE_INTEGER*)&seek_target, NULL, SEEK_SET);
else if (seek_target >= filesize)
break;
}
while (From_Buffer_Size>0 && last_seek_target != seek_target);
MI.Open_Buffer_Finalize();
MI.Option(_T("Complete"));
MI.Option(_T("Inform"));
str = MI.Inform().c_str();
MI.Close();
CloseHandle(h_file);
}
wchar_t *p = (wchar_t*)str.c_str();
wchar_t *p2 = wcsstr(p, L"\n");
wchar_t tmp[1024];
bool next_is_a_header = true;
//TreeView_DeleteAllItems (root);
TreeView_DeleteItem(root, file);
file = InsertTreeviewItem(root, filename, TVI_ROOT);
wcscat(m_msg, filename);
wcscat(m_msg, L"\r\n");
HTREEITEM insert_position = file;
HTREEITEM headers[4096] = {0};
int headers_count = 0;
wchar_t tbl[3][20]={L"\t", L"\t\t", L"\t\t\t"};
while (true)
{
if (p2)
//.........这里部分代码省略.........