Esempio n. 1
0
CLSID StringToCLSID(const std::wstring &str)
//------------------------------------------
{
	CLSID clsid = CLSID();
	std::vector<OLECHAR> tmp(str.c_str(), str.c_str() + str.length() + 1);
	if(::CLSIDFromString(&tmp[0], &clsid) != S_OK)
	{
		return CLSID();
	}
	return clsid;
}
Esempio n. 2
0
bool IsCLSID(const std::wstring &str)
//-----------------------------------
{
	CLSID clsid = CLSID();
	std::vector<OLECHAR> tmp(str.c_str(), str.c_str() + str.length() + 1);
	return (::CLSIDFromString(&tmp[0], &clsid) == S_OK);
}
Esempio n. 3
0
 CLSID CodecInfo::__GetCodecClass(UINT32 unIndex, PROPID propId)
 {
     PropertyVariant propVariant = m_codecLibrary.GetMethodProperty(
         unIndex, propId);
     switch (propVariant.vt)
     {
     case VT_BSTR:
         return *reinterpret_cast<const GUID *>(propVariant.bstrVal);
     case VT_EMPTY:
         return CLSID();
     default:
         throw LibraryException("Cannot get the codec class.");
     }
 }