Renaming Project Hierarchy Nodes (C++)
You can rename a project folder hierarchy node by using the HierUtil7 project framework for unmanaged C++. For more information, see HierUtil7 Sample.
Expanding the Hierarchy node
To expand the hierarchy node and rename the folder
Select the hierarchy node by using the following method:
IfFailGo(pNode->ExtExpand(EXPF_SelectItem, GUID_MacroExplorer));
pNode
is the hierarchy container corresponding to the folder andEXPF_SelectItem
is from the EXPANDFLAGS enumeration. TheGUID_MacroExplorer
is a GUID constant defined in Vsshell.idl and is an example forrguidPersistenceSlot
in the function signature ofExtExpand
, defined in Hu_node.h.HRESULT ExtExpand(EXPANDFLAGS expandflags, REFGUID rguidPersistenceSlot = GUID_SolutionExplorer) const;
You can find the Hu_node.h file in the folder, <installation root>\Program Files\VSIP 8.0\EnvSDK\common\hierutil7:
Rename the folder by posting the rename command by using PostExecCommand
IfFailGo(srpVsUIShell->PostExecCommand(&guidVSStd97, cmdidRename, 0, NULL));
srpVsUIShell
is a IVsUIShell pointer:<IVsUIShell>``srpVsUIShell
.guiVSStd97
is a unique identifier of the command group to which the commandcmdidRename
belongs, defined in Vsshlids.h.