OriginObject::GetParent

Description

Get the parent object of this Origin object.

Syntax

void GetParent( OriginObject & obj )

Parameters

obj
[output] Object to which parent will be attached

Return

Examples

EX1

// Pass the name of a workbook and get the worksheet object of a column via GetParent
int OriginObject_GetParent_ex1(string strBookName = "Book1")
{
    Worksheet wks;
    Column col(strBookName, 0); // Get the first column of the active sheet of strBookName 
    if( col.IsValid() )
    {
        col.GetParent(wks); // wks is parent object (a worksheet layer) which contains col
        if( wks.IsValid() )
            printf("Column %s is contained in Worksheet %s\n", col.GetName(), wks.GetName());
        else
            printf("There was a problem getting the Worksheet object\n");
    }
    else
        printf("There was a problem getting the Column object\n");
    return 0;
}

Remark

Get the parent object of this Origin object. The parent object is the object which contains this Origin object (e.g. a Layer object is contained in a Page object so the Page object is the parent object of the Layer).

See Also

header to Include

origin.h