2.2.4.38.40 Project::GetTree

Description

Returns the Tree if available in the manager, referred to by name, lpcszName

Syntax

BOOL GetTree( LPCSTR lpcszName, TreeNode & tr )

Parameters

lpcszName
[input]name of the Tree to be returned. If NULL is passed in, outputted tree contains a Project Explorer-like structure of folder, books,sheets, and columns in the project.
tr
[output] contains the tree returned if successful

Return

Returns non zero if successful, else zero

Examples

EX1

void Project_GetTree_Ex1()
{
    string strTreeName = "MyTree";

    Tree tr;
    tr.SetAttribute(STR_LABEL_ATTRIB, strTreeName);
    tr.node1.nVal = 1234;
    tr.node2.strVal = "abcd";
    
    int nTree = Project.AddTree(strTreeName, tr);
    
    TreeNode trGet;
    BOOL bRet = Project.GetTree(strTreeName, trGet);
    if(!trGet.IsValid())
        out_str("Error!");
    else
        out_tree(trGet);
}

EX2

// Returns Project Explorer-like structure in the tree.
void Project_GetTree_Ex2()
{
	Tree tr;
	Project.GetTree(NULL, tr);
	out_tree(tr);
	
	// Put a break point below to see more details in Variables window of Code Builder.
	int bp = 1;
}

Remark

See Also

Project::AddTree, Project::DeleteTree

Header to Include

origin.h