String strvalue = ptrfolder-> getdetailsof (_ variant_t (idispatch *) ptritem), I );
This is the key idispatch usage.
# 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)); _variant_t var((short)Shell32::ssfRECENT); Shell32::FolderPtr ptrFolder = ptrShell->NameSpace("C://");Shell32::FolderItemPtr ptrItem = ptrFolder->ParseName("output.mp4");for( int i = 0; i < 10; i++ ) { string strName = ptrFolder->GetDetailsOf(0, i); cout << i <<strName << ":"; //string strValue = ptrFolder->GetDetailsOf(ptrItem, i); string strValue = ptrFolder->GetDetailsOf( _variant_t((IDispatch *)ptrItem), i);cout << strValue << endl; }
ptrItem.Release();ptrFolder.Release();ptrShell.Release();
CoUninitialize();
return 0;}