[This is preliminary documentation and subject to change.]
CITextToFullTree creates a complete DBCOMMANDTREE from a query string, output columns, sort columns, and a set of custom properties.
STDAPI CITextToFullTree(
WCHAR const * pwszRestriction,
WCHAR const * pwszColumns,
WCHAR const * pwszSortColumns,
WCHAR const * pwszReserved,
DBCOMMANDTREE * * ppTree,
ULONG cProperties,
CIPROPERTYDEF * pProperties,
LCID LocaleID
);
An HRESULT, S_OK if successful.
The query tree allocated by CITextToSelectTree must be freed either with ICommandTree::FreeCommandTree or passed to ICommandTree::SetCommandTree with the fCopy parameter set to FALSE.
This sample code creates a command tree. The list of properties returned by the query include myproperty, path, and size. The sort order is first by rank descending, then by path ascending. The default system locale is used to create the command tree.
CIPROPERTYDEF aProperties[1];
const GUID guidOffice = { 0xd5cdd505, 0x2e9c, 0x101b,
0x93, 0x97, 0x08, 0x00, 0x2b, 0x2c, 0xf9, 0xae }
};
aProperties[0].wcsFriendlyName = L"ISSUENUMBER";
aProperties[0].dbType = DBTYPE_R8;
aProperties[0].dbCol.uGuid.guid = guidOffice;
aProperties[0].dbCol.eKind = DBKIND_GUID_NAME;
aProperties[0].dbCol.pwszName.ulPropid = L"ISSUENUMBER";
DBCOMMANDTREE * pTree;
HRESULT hr = CiTextToFullTree( L"microsoft and @issuenumber=2",
L"size,path,issuenumber",
L"rank[d],path[a]",
&pTree,
1,
aProperties,
GetSystemDefaultLCID() );
if ( SUCCEEDED( hr ) )
{
hr = pICommand->SetCommandTree( pTree,
DBCOMMANDREUSE_NONE,
FALSE );
if ( SUCCEEDED( hr ) )
{
// ...
// execute a query
// ...
}
}
This is the DBCOMMANDTREE pTree created by the example code:
DBCOMMANDTREE pTree Created by Example Code