本文整理汇总了C++中nwindows::ncom::CPropVariant::Detach方法的典型用法代码示例。如果您正苦于以下问题:C++ CPropVariant::Detach方法的具体用法?C++ CPropVariant::Detach怎么用?C++ CPropVariant::Detach使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nwindows::ncom::CPropVariant
的用法示例。
在下文中一共展示了CPropVariant::Detach方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetProperty
STDMETHODIMP CCodecs::GetProperty(UINT32 index, PROPID propID, PROPVARIANT *value)
{
#ifdef EXPORT_CODECS
if (index < g_NumCodecs)
return GetMethodProperty(index, propID, value);
#endif
const CDllCodecInfo &ci = Codecs[index
#ifdef EXPORT_CODECS
- g_NumCodecs
#endif
];
if (propID == NMethodPropID::kDecoderIsAssigned)
{
NWindows::NCOM::CPropVariant propVariant;
propVariant = ci.DecoderIsAssigned;
propVariant.Detach(value);
return S_OK;
}
if (propID == NMethodPropID::kEncoderIsAssigned)
{
NWindows::NCOM::CPropVariant propVariant;
propVariant = ci.EncoderIsAssigned;
propVariant.Detach(value);
return S_OK;
}
return Libs[ci.LibIndex].GetMethodProperty(ci.CodecIndex, propID, value);
}
示例2: switch
STDMETHODIMP P7ZipArchiveUpdateCallback::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *value)
{
NWindows::NCOM::CPropVariant prop;
if (propID == kpidIsAnti)
{
prop = false;
prop.Detach(value);
return S_OK;
}
{
const CDirItem &dirItem = (*DirItems)[index];
switch(propID)
{
case kpidPath: prop = dirItem.Name; break;
case kpidIsDir: prop = dirItem.isDir(); break;
case kpidSize: prop = dirItem.Size; break;
case kpidAttrib: prop = dirItem.Attrib; break;
case kpidCTime: prop = dirItem.CTime; break;
case kpidATime: prop = dirItem.ATime; break;
case kpidMTime: prop = dirItem.MTime; break;
}
}
prop.Detach(value);
return S_OK;
}
示例3: GetProperty
STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *value)
{
COM_TRY_BEGIN
NWindows::NCOM::CPropVariant prop;
const CItemEx &item = _items[index];
switch(propID)
{
case kpidPath: prop = NItemName::GetOSName2(MultiByteToUnicodeString(item.Name, CP_OEMCP)); break;
case kpidIsDir: prop = item.IsDir(); break;
case kpidSize: prop = item.Size; break;
case kpidPackSize: prop = item.GetPackSize(); break;
case kpidMTime:
if (item.MTime != 0)
{
FILETIME ft;
NTime::UnixTimeToFileTime(item.MTime, ft);
prop = ft;
}
break;
case kpidUser: prop = MultiByteToUnicodeString(item.UserName, CP_OEMCP); break;
case kpidGroup: prop = MultiByteToUnicodeString(item.GroupName, CP_OEMCP); break;
}
prop.Detach(value);
return S_OK;
COM_TRY_END
}
示例4: GetHandlerProperty
STDAPI GetHandlerProperty(PROPID propID, PROPVARIANT *value)
{
NWindows::NCOM::CPropVariant propVariant;
switch(propID)
{
case NArchive::kName:
propVariant = L"Cab";
break;
case NArchive::kClassID:
{
if ((value->bstrVal = ::SysAllocStringByteLen(
(const char *)&CLSID_CCabHandler, sizeof(GUID))) != 0)
value->vt = VT_BSTR;
return S_OK;
}
case NArchive::kExtension:
propVariant = L"cab";
break;
case NArchive::kUpdate:
propVariant = false;
break;
case NArchive::kKeepName:
propVariant = false;
break;
case NArchive::kStartSignature:
{
const char sig[] = { 0x4D, 0x53, 0x43, 0x46 };
if ((value->bstrVal = ::SysAllocStringByteLen(sig, 4)) != 0)
value->vt = VT_BSTR;
return S_OK;
}
}
propVariant.Detach(value);
return S_OK;
}
示例5: GetProperty
STDMETHODIMP COpenArchiveCallback::GetProperty(PROPID propID, PROPVARIANT *value)
{
NWindows::NCOM::CPropVariant prop;
if (_subArchiveMode)
{
switch(propID)
{
case kpidName: prop = _subArchiveName; break;
}
}
else
{
switch(propID)
{
case kpidName: prop = _fileInfo.Name; break;
case kpidIsDir: prop = _fileInfo.IsDir(); break;
case kpidSize: prop = _fileInfo.Size; break;
case kpidAttrib: prop = (UInt32)_fileInfo.Attrib; break;
case kpidCTime: prop = _fileInfo.CTime; break;
case kpidATime: prop = _fileInfo.ATime; break;
case kpidMTime: prop = _fileInfo.MTime; break;
}
}
prop.Detach(value);
return S_OK;
}
示例6: GetArchiveProperty
STDMETHODIMP CHandler::GetArchiveProperty(PROPID propID, PROPVARIANT *value)
{
COM_TRY_BEGIN
NWindows::NCOM::CPropVariant prop;
const CVolumeDescriptor &vol = _archive.VolDescs[_archive.MainVolDescIndex];
switch(propID)
{
case kpidComment:
{
AString s;
ADD_STRING("System", SystemId);
ADD_STRING("Volume", VolumeId);
ADD_STRING("VolumeSet", VolumeSetId);
ADD_STRING("Publisher", PublisherId);
ADD_STRING("Preparer", DataPreparerId);
ADD_STRING("Application", ApplicationId);
ADD_STRING("Copyright", CopyrightFileId);
ADD_STRING("Abstract", AbstractFileId);
ADD_STRING("Bib", BibFileId);
prop = s;
break;
}
case kpidCTime: { FILETIME utc; if (vol.CTime.GetFileTime(utc)) prop = utc; break; }
case kpidMTime: { FILETIME utc; if (vol.MTime.GetFileTime(utc)) prop = utc; break; }
// case kpidPhySize: break;
// case kpidHeadersSize: break;
case kpidError: if (_archive.IncorrectBigEndian) prop = "Incorrect big-endian headers"; break;
}
prop.Detach(value);
return S_OK;
COM_TRY_END
}
示例7: GetProperty
STDMETHODIMP CHandler::GetProperty(UInt32 /* index */, PROPID propID, PROPVARIANT *value)
{
NWindows::NCOM::CPropVariant prop;
switch(propID)
{
case kpidPackSize: prop = _packSize; break;
}
prop.Detach(value);
return S_OK;
}
示例8: GetArchiveProperty
STDMETHODIMP CHandler::GetArchiveProperty(PROPID propID, PROPVARIANT *value)
{
NWindows::NCOM::CPropVariant prop;
switch (propID)
{
case kpidPhySizeCantBeDetected: prop = true; break;
}
prop.Detach(value);
return S_OK;
}
示例9: GetFolderProperty
STDMETHODIMP CRootFolder::GetFolderProperty(PROPID propID, PROPVARIANT *value)
{
NWindows::NCOM::CPropVariant prop;
switch(propID)
{
case kpidType: prop = L"RootFolder"; break;
case kpidPath: prop = L""; break;
}
prop.Detach(value);
return S_OK;
}
示例10: GetFolderProperty
STDMETHODIMP CPhysDriveFolder::GetFolderProperty(PROPID propID, PROPVARIANT *value)
{
NWindows::NCOM::CPropVariant prop;
switch(propID)
{
case kpidType: prop = L"PhysDrive"; break;
case kpidPath: prop = (GetFullPath() + L"\\"); break;
}
prop.Detach(value);
return S_OK;
}
示例11:
HRESULT C7ZipCompressCodecsInfo::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *value)
{
C7ZipCodecInfo * pCodec = dynamic_cast<C7ZipCodecInfo *>(m_CodecInfoArray[index]);
if (propID == NMethodPropID::kDecoderIsAssigned)
{
NWindows::NCOM::CPropVariant propVariant;
propVariant = pCodec->DecoderAssigned;
propVariant.Detach(value);
return S_OK;
}
if (propID == NMethodPropID::kEncoderIsAssigned)
{
NWindows::NCOM::CPropVariant propVariant;
propVariant = pCodec->EncoderAssigned;
propVariant.Detach(value);
return S_OK;
}
return pCodec->Functions->v.GetMethodProperty(pCodec->CodecIndex, propID, value);
}
示例12: GetFolderProperty
STDMETHODIMP CFSFolder::GetFolderProperty(PROPID propID, PROPVARIANT *value)
{
COM_TRY_BEGIN
NWindows::NCOM::CPropVariant prop;
switch(propID)
{
case kpidType: prop = L"FSFolder"; break;
case kpidPath: prop = _path; break;
}
prop.Detach(value);
return S_OK;
COM_TRY_END
}
示例13: GetProperty
STDMETHODIMP CHandler::GetProperty(UInt32 /* index */, PROPID propID, PROPVARIANT *value)
{
COM_TRY_BEGIN
NWindows::NCOM::CPropVariant prop;
switch (propID)
{
case kpidPath: if (!_name.IsEmpty()) prop = _name; break;
case kpidSize: if (_unpackSize_Defined || _inStream) prop = _unpackSize; break;
case kpidPackSize: if (_packSize_Defined || _inStream) prop = _packSize; break;
}
prop.Detach(value);
return S_OK;
COM_TRY_END
}
示例14: GetProperty
IMP_IInArchive_Props
IMP_IInArchive_ArcProps_NO
#define MACH_ARCH_ABI64 0x1000000
#define MACH_MACHINE_386 7
#define MACH_MACHINE_ARM 12
#define MACH_MACHINE_SPARC 14
#define MACH_MACHINE_PPC 18
#define MACH_MACHINE_PPC64 (MACH_MACHINE_PPC | MACH_ARCH_ABI64)
#define MACH_MACHINE_AMD64 (MACH_MACHINE_386 | MACH_ARCH_ABI64)
STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *value)
{
NWindows::NCOM::CPropVariant prop;
const CItem &item = _items[index];
switch(propID)
{
case kpidExtension:
{
const wchar_t *ext;
if (item.IsTail)
ext = L"tail";
else
{
switch(item.Type)
{
case MACH_MACHINE_386: ext = L"86"; break;
case MACH_MACHINE_ARM: ext = L"arm"; break;
case MACH_MACHINE_SPARC: ext = L"sparc"; break;
case MACH_MACHINE_PPC: ext = L"ppc"; break;
case MACH_MACHINE_PPC64: ext = L"ppc64"; break;
case MACH_MACHINE_AMD64: ext = L"x64"; break;
default: ext = L"unknown"; break;
}
}
prop = ext;
break;
}
case kpidSize:
case kpidPackSize:
prop = (UInt64)item.Size;
break;
}
prop.Detach(value);
return S_OK;
}
示例15: GetArchiveProperty
STDMETHODIMP CHandler::GetArchiveProperty(PROPID propID, PROPVARIANT *value)
{
NWindows::NCOM::CPropVariant prop;
switch (propID)
{
case kpidPhySize: if (_phySize != 0) prop = _phySize; break;
case kpidErrorFlags:
{
UInt32 v = 0;
if (!_isArc) v |= kpv_ErrorFlags_IsNotArc;;
if (_needMoreInput) v |= kpv_ErrorFlags_UnexpectedEnd;
if (_dataError) v |= kpv_ErrorFlags_DataError;
prop = v;
}
}
prop.Detach(value);
return S_OK;
}