2.2.4.32.22 OriginObject::GetMemory

Description

Get named binary storage into vector of bytes

Syntax

BOOL GetMemory( LPCSTR lpcszName, vector<byte> & vb )

Parameters

lpcszName
[input] Storage name, must be valid C identifier
vb
[output] vector of bytes to be retrieved

Return

TRUE if success FALSE if name storage does not exist

Examples

EX1

// Use the Import Wizard to import some data into a worksheet
// Run the example
void OriginObject_GetMemory_Ex1()
{
    Page pg = Project.Pages();
    if(!pg)
        return;
    vector<byte> vb;
    if(pg.GetMemory("Files", vb))    // Get the "Files" storage which is created by the Import Wizard
    {
        string strContents;
        if(strContents.SetBytes(vb))
            strContents.Write(WRITE_COMPILER_OUTPUT);    // Output the storage to CodeBuilder's Output window
    }
}

Remark

Get named binary storage into vector of bytes

See Also

OriginObject::SetMemory

Header to Include

origin.h