本文整理汇总了C++中CMyComPtr::GetFolderPropertyInfo方法的典型用法代码示例。如果您正苦于以下问题:C++ CMyComPtr::GetFolderPropertyInfo方法的具体用法?C++ CMyComPtr::GetFolderPropertyInfo怎么用?C++ CMyComPtr::GetFolderPropertyInfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMyComPtr
的用法示例。
在下文中一共展示了CMyComPtr::GetFolderPropertyInfo方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Properties
void CPanel::Properties()
{
CMyComPtr<IGetFolderArcProps> getFolderArcProps;
_folder.QueryInterface(IID_IGetFolderArcProps, &getFolderArcProps);
if (!getFolderArcProps)
{
InvokeSystemCommand("properties");
return;
}
{
UString message;
CRecordVector<UInt32> operatedIndices;
GetOperatedItemIndices(operatedIndices);
if (operatedIndices.Size() == 1)
{
UInt32 index = operatedIndices[0];
// message += L"Item:\n";
UInt32 numProps;
if (_folder->GetNumberOfProperties(&numProps) == S_OK)
{
for (UInt32 i = 0; i < numProps; i++)
{
CMyComBSTR name;
PROPID propID;
VARTYPE varType;
if (_folder->GetPropertyInfo(i, &name, &propID, &varType) != S_OK)
continue;
NCOM::CPropVariant prop;
if (_folder->GetProperty(index, propID, &prop) != S_OK)
continue;
AddPropertyString(propID, name, prop, message);
}
}
message += kSeparator;
}
/*
message += LangString(IDS_PROP_FILE_TYPE, 0x02000214);
message += kPropValueSeparator;
message += GetFolderTypeID();
message += L"\n";
*/
{
NCOM::CPropVariant prop;
if (_folder->GetFolderProperty(kpidPath, &prop) == S_OK)
{
AddPropertyString(kpidName, L"Path", prop, message);
}
}
CMyComPtr<IFolderProperties> folderProperties;
_folder.QueryInterface(IID_IFolderProperties, &folderProperties);
if (folderProperties)
{
UInt32 numProps;
if (folderProperties->GetNumberOfFolderProperties(&numProps) == S_OK)
{
for (UInt32 i = 0; i < numProps; i++)
{
CMyComBSTR name;
PROPID propID;
VARTYPE vt;
if (folderProperties->GetFolderPropertyInfo(i, &name, &propID, &vt) != S_OK)
continue;
NCOM::CPropVariant prop;
if (_folder->GetFolderProperty(propID, &prop) != S_OK)
continue;
AddPropertyString(propID, name, prop, message);
}
}
}
CMyComPtr<IGetFolderArcProps> getFolderArcProps;
_folder.QueryInterface(IID_IGetFolderArcProps, &getFolderArcProps);
if (getFolderArcProps)
{
CMyComPtr<IFolderArcProps> getProps;
getFolderArcProps->GetFolderArcProps(&getProps);
if (getProps)
{
UInt32 numLevels;
if (getProps->GetArcNumLevels(&numLevels) != S_OK)
numLevels = 0;
for (UInt32 level2 = 0; level2 < numLevels; level2++)
{
{
UInt32 level = numLevels - 1 - level2;
UInt32 numProps;
if (getProps->GetArcNumProps(level, &numProps) == S_OK)
{
message += kSeparator;
for (Int32 i = -3; i < (Int32)numProps; i++)
{
CMyComBSTR name;
PROPID propID;
//.........这里部分代码省略.........
示例2: GetOpenPluginInfo
void CPlugin::GetOpenPluginInfo(struct OpenPluginInfo *info)
{
info->StructSize = sizeof(*info);
info->Flags = OPIF_USEFILTER | OPIF_USESORTGROUPS| OPIF_USEHIGHLIGHTING|
OPIF_ADDDOTS | OPIF_COMPAREFATTIME;
UINT codePage = ::AreFileApisANSI() ? CP_ACP : CP_OEMCP;
MyStringCopy(m_FileNameBuffer, (const char *)UnicodeStringToMultiByte(m_FileName, codePage));
info->HostFile = m_FileNameBuffer; // test it it is not static
MyStringCopy(m_CurrentDirBuffer, (const char *)UnicodeStringToMultiByte(m_CurrentDir, CP_OEMCP));
info->CurDir = m_CurrentDirBuffer;
info->Format = kPluginFormatName;
UString name;
{
UString fullName;
int index;
NFile::NDirectory::MyGetFullPathName(m_FileName, fullName, index);
name = fullName.Mid(index);
}
m_PannelTitle =
UString(L' ') +
_archiveTypeName +
UString(L':') +
name +
UString(L' ');
if (!m_CurrentDir.IsEmpty())
{
// m_PannelTitle += '\\';
m_PannelTitle += m_CurrentDir;
}
MyStringCopy(m_PannelTitleBuffer, (const char *)UnicodeStringToMultiByte(m_PannelTitle, CP_OEMCP));
info->PanelTitle = m_PannelTitleBuffer;
memset(m_InfoLines, 0, sizeof(m_InfoLines));
MyStringCopy(m_InfoLines[0].Text, "");
m_InfoLines[0].Separator = TRUE;
MyStringCopy(m_InfoLines[1].Text, g_StartupInfo.GetMsgString(NMessageID::kArchiveType));
MyStringCopy(m_InfoLines[1].Data, (const char *)UnicodeStringToMultiByte(_archiveTypeName, CP_OEMCP));
int numItems = 2;
{
CMyComPtr<IFolderProperties> folderProperties;
_folder.QueryInterface(IID_IFolderProperties, &folderProperties);
if (folderProperties)
{
UInt32 numProps;
if (folderProperties->GetNumberOfFolderProperties(&numProps) == S_OK)
{
for (UInt32 i = 0; i < numProps && numItems < kNumInfoLinesMax; i++)
{
CMyComBSTR name;
PROPID propID;
VARTYPE vt;
if (folderProperties->GetFolderPropertyInfo(i, &name, &propID, &vt) != S_OK)
continue;
NCOM::CPropVariant prop;
if (_folder->GetFolderProperty(propID, &prop) != S_OK || prop.vt == VT_EMPTY)
continue;
InfoPanelLine &item = m_InfoLines[numItems++];
MyStringCopy(item.Text, (const char *)GetNameOfProp2(propID, name));
MyStringCopy(item.Data, (const char *)PropToString2(prop, propID));
}
}
}
}
if (numItems < kNumInfoLinesMax)
{
InfoPanelLine &item = m_InfoLines[numItems++];
MyStringCopy(item.Text, "");
MyStringCopy(item.Data, "");
item.Separator = TRUE;
}
{
CMyComPtr<IGetFolderArchiveProperties> getFolderArchiveProperties;
_folder.QueryInterface(IID_IGetFolderArchiveProperties, &getFolderArchiveProperties);
if (getFolderArchiveProperties)
{
CMyComPtr<IFolderArchiveProperties> getProps;
getFolderArchiveProperties->GetFolderArchiveProperties(&getProps);
if (getProps)
{
UInt32 numProps;
if (getProps->GetNumberOfArchiveProperties(&numProps) == S_OK)
{
/*
if (numProps > 0)
message += kSeparator;
*/
for (UInt32 i = 0; i < numProps && numItems < kNumInfoLinesMax; i++)
//.........这里部分代码省略.........
示例3: Properties
void CPanel::Properties()
{
CMyComPtr<IGetFolderArchiveProperties> getFolderArchiveProperties;
_folder.QueryInterface(IID_IGetFolderArchiveProperties, &getFolderArchiveProperties);
if (!getFolderArchiveProperties)
{
InvokeSystemCommand("properties");
return;
}
{
UString message;
CRecordVector<UInt32> operatedIndices;
GetOperatedItemIndices(operatedIndices);
if (operatedIndices.Size() == 1)
{
UInt32 index = operatedIndices[0];
// message += L"Item:\n";
UInt32 numProps;
if (_folder->GetNumberOfProperties(&numProps) == S_OK)
{
for (UInt32 i = 0; i < numProps; i++)
{
CMyComBSTR name;
PROPID propID;
VARTYPE varType;
if (_folder->GetPropertyInfo(i, &name, &propID, &varType) != S_OK)
continue;
NCOM::CPropVariant prop;
if (_folder->GetProperty(index, propID, &prop) != S_OK)
continue;
AddPropertyString(propID, name, prop, message);
}
}
message += kSeparator;
}
message += LangString(IDS_PROPERTY_FILE_TYPE, 0x02000214);
message += kPropValueSeparator;
message += GetFolderTypeID();
message += L"\n";
{
NCOM::CPropVariant prop;
if (_folder->GetFolderProperty(kpidPath, &prop) == S_OK)
{
AddPropertyString(kpidName, L"Path", prop, message);
}
}
CMyComPtr<IFolderProperties> folderProperties;
_folder.QueryInterface(IID_IFolderProperties, &folderProperties);
if (folderProperties)
{
UInt32 numProps;
if (folderProperties->GetNumberOfFolderProperties(&numProps) == S_OK)
{
for (UInt32 i = 0; i < numProps; i++)
{
CMyComBSTR name;
PROPID propID;
VARTYPE vt;
if (folderProperties->GetFolderPropertyInfo(i, &name, &propID, &vt) != S_OK)
continue;
NCOM::CPropVariant prop;
if (_folder->GetFolderProperty(propID, &prop) != S_OK)
continue;
AddPropertyString(propID, name, prop, message);
}
}
}
CMyComPtr<IGetFolderArchiveProperties> getFolderArchiveProperties;
_folder.QueryInterface(IID_IGetFolderArchiveProperties, &getFolderArchiveProperties);
if (getFolderArchiveProperties)
{
CMyComPtr<IFolderArchiveProperties> getProps;
getFolderArchiveProperties->GetFolderArchiveProperties(&getProps);
if (getProps)
{
UInt32 numProps;
if (getProps->GetNumberOfArchiveProperties(&numProps) == S_OK)
{
if (numProps > 0)
message += kSeparator;
for (UInt32 i = 0; i < numProps; i++)
{
CMyComBSTR name;
PROPID propID;
VARTYPE vt;
if (getProps->GetArchivePropertyInfo(i, &name, &propID, &vt) != S_OK)
continue;
NCOM::CPropVariant prop;
if (getProps->GetArchiveProperty(propID, &prop) != S_OK)
continue;
AddPropertyString(propID, name, prop, message);
}
//.........这里部分代码省略.........
示例4: GetOpenPluginInfo
void CPlugin::GetOpenPluginInfo(struct OpenPluginInfo *info)
{
info->StructSize = sizeof(*info);
info->Flags = OPIF_USEFILTER | OPIF_USESORTGROUPS | OPIF_USEHIGHLIGHTING |
OPIF_ADDDOTS | OPIF_COMPAREFATTIME;
COPY_STR_LIMITED(m_FileNameBuffer, UnicodeStringToMultiByte(fs2us(m_FileName), CP_OEMCP));
info->HostFile = m_FileNameBuffer; // test it it is not static
COPY_STR_LIMITED(m_CurrentDirBuffer, UnicodeStringToMultiByte(m_CurrentDir, CP_OEMCP));
info->CurDir = m_CurrentDirBuffer;
info->Format = kPluginFormatName;
UString name;
{
FString dirPrefix, fileName;
NFile::NDirectory::GetFullPathAndSplit(m_FileName, dirPrefix, fileName);
name = fs2us(fileName);
}
m_PannelTitle =
UString(L' ') +
_archiveTypeName +
UString(L':') +
name +
UString(L' ');
if (!m_CurrentDir.IsEmpty())
{
// m_PannelTitle += '\\';
m_PannelTitle += m_CurrentDir;
}
COPY_STR_LIMITED(m_PannelTitleBuffer, UnicodeStringToMultiByte(m_PannelTitle, CP_OEMCP));
info->PanelTitle = m_PannelTitleBuffer;
memset(m_InfoLines, 0, sizeof(m_InfoLines));
MyStringCopy(m_InfoLines[0].Text, "");
m_InfoLines[0].Separator = TRUE;
MyStringCopy(m_InfoLines[1].Text, g_StartupInfo.GetMsgString(NMessageID::kArchiveType));
MyStringCopy(m_InfoLines[1].Data, (const char *)UnicodeStringToMultiByte(_archiveTypeName, CP_OEMCP));
int numItems = 2;
{
CMyComPtr<IFolderProperties> folderProperties;
_folder.QueryInterface(IID_IFolderProperties, &folderProperties);
if (folderProperties)
{
UInt32 numProps;
if (folderProperties->GetNumberOfFolderProperties(&numProps) == S_OK)
{
for (UInt32 i = 0; i < numProps && numItems < kNumInfoLinesMax; i++)
{
CMyComBSTR name;
PROPID propID;
VARTYPE vt;
if (folderProperties->GetFolderPropertyInfo(i, &name, &propID, &vt) != S_OK)
continue;
NCOM::CPropVariant prop;
if (_folder->GetFolderProperty(propID, &prop) != S_OK || prop.vt == VT_EMPTY)
continue;
InfoPanelLine &item = m_InfoLines[numItems++];
COPY_STR_LIMITED(item.Text, GetNameOfProp2(propID, name));
COPY_STR_LIMITED(item.Data, PropToString2(prop, propID));
}
}
}
}
/*
if (numItems < kNumInfoLinesMax)
{
InsertSeparator(m_InfoLines, numItems);
}
*/
{
CMyComPtr<IGetFolderArcProps> getFolderArcProps;
_folder.QueryInterface(IID_IGetFolderArcProps, &getFolderArcProps);
if (getFolderArcProps)
{
CMyComPtr<IFolderArcProps> getProps;
getFolderArcProps->GetFolderArcProps(&getProps);
if (getProps)
{
UInt32 numLevels;
if (getProps->GetArcNumLevels(&numLevels) != S_OK)
numLevels = 0;
for (UInt32 level2 = 0; level2 < numLevels; level2++)
{
{
UInt32 level = numLevels - 1 - level2;
UInt32 numProps;
if (getProps->GetArcNumProps(level, &numProps) == S_OK)
{
InsertSeparator(m_InfoLines, numItems);
for (Int32 i = -3; i < (Int32)numProps && numItems < kNumInfoLinesMax; i++)
//.........这里部分代码省略.........