📄 main.cpp
字号:
//*****************************************************************************
//
// Microsoft Windows Media
// Copyright (C) Microsoft Corporation. All rights reserved.
//
// FileName: main.cpp
//
// Abstract: This sample shows properties on a Windows Media file:
// Number of streams, codec, protected, bitrate, stream number,
// seekable, and stridable.
//
//*****************************************************************************
#include "ListProps.h"
///////////////////////////////////////////////////////////////////////////////
void usage(void)
{
_tprintf(_T("WMProp <infile>\n"));
_tprintf(_T("infile = Input Windows Media file for which properties are sought\n"));
}
int __cdecl _tmain( int argc, TCHAR* argv[] )
{
if( argc != 2 )
{
usage();
MessageBox(NULL, "Running ternimated.", "ListProps", MB_OK);
return( -1 );
}
HRESULT hr = S_OK;
hr = CoInitialize(NULL);
if (FAILED(hr))
{
_tprintf(_T("CoInitialize failed: (hr=0x%08x)\n"), hr);
return hr;
}
CWMProp wmProp(&hr);
if (FAILED(hr))
{
_tprintf(_T("Internal error %lu\n"), hr);
return hr;
}
#ifndef UNICODE //
// Unicode implementation
//
WCHAR wszFileName[MAX_PATH];
//
// Check to ensure a buffer over run does not occur
//
if (_tcslen(argv[1]) < MAX_PATH)
{
if (0 == MultiByteToWideChar(CP_ACP, 0, argv[1], _tcslen(argv[1]) + 1, wszFileName, MAX_PATH))
{
_tprintf(_T("Internal error %lu\n"), GetLastError());
return E_UNEXPECTED;
}
hr = wmProp.Open(wszFileName);
}
else
{
_tprintf(_T("File name argument is too long.\n"));
return E_INVALIDARG;
}
#else //
// Non-Unicode implementation
//
if (_tcslen(argv[1]) < MAX_PATH)
{
hr = wmProp.Open(argv[1]);
}
else
{
_tprintf(_T("File name argument is too long.\n"));
return E_INVALIDARG;
}
#endif // UNICODE
CoUninitialize();
MessageBox(NULL, "Running ternimated.", "ListProps", MB_OK);
return hr;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -