Product Documentation

c-treeDB API for C++ - Developers Guide

Previous Topic

Next Topic

CTResource::GetDataLength

Retrieve the resource data length.

Declaration

VRLEN CTResource::GetDataLength() const;

Description

Retrieves the resource data length in bytes.

Return

Returns the resource data length.

Example


CTDBRET ReadMyResource(CTHANDLE Handle, ULONG type, ULONG number, pTEXT& data, VRLEN& size)

{

CTResource* hRes = new CTResource(Handle, type, number, NULL);

try

{

if (hRes->Find(type, number))

{

size = hRes->GetDataLength();

if (size > 0)

{

data = new TEXT[size];

memcpy(data, hRes->GetData(), size);

}

}

}

catch (CTException &err)

{

printf("Error %d - %s\n", err.GetErrorCode(), err.GetErrorMsg());

}

delete hRes;

}

See Also

CTResource::Add(), CTResource::Delete(), CTResource::Update(), CTResource::First(), CTResource::Next(), CTResource::Find(), CTResource::GetType(), CTResource::SetType(), CTResource::GetNumber(), CTResource::SetNumber(), CTResource::GetName(), CTResource::SetName(), CTResource::GetData(), CTResource::SetData(), CTResource::Unlock(), CTResource::IsLocked()

TOCIndex