高手看下,GetDetailsOf()获取文件属性的问题
#include <iostream>
#include <string>
#import <Shell32.dll>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
CoInitialize(NULL);
Shell32::IShellDispatchPtr ptrShell;
ptrShell.CreateInstance(__uuidof(Shell32::Shell));
Shell32::FolderPtr ptrFolder = ptrShell->NameSpace("C:\\Windows");
Shell32::FolderItemPtr ptrItem = ptrFolder->ParseName("clock.avi");
for( int i = 0; i< 50; i++ )
{
string strName = ptrFolder->GetDetailsOf(0, i);
cout << i << strName << ":";
string strValue = ptrFolder->GetDetailsOf("clock.avi", i);
cout << strValue << endl;
}
ptrItem.Release();
ptrFolder.Release();
ptrShell.Release();
CoUninitialize();
return 0;
}
我想获取文件属性的值,为什么返回的是属性名字?