Product Documentation

c-treeDB API for C++ - Developers Guide

Previous Topic

Next Topic

CTResource::Update

Update an existing resource.

Declaration

void CTResource::Update(pVOID data, VRLEN size);

Description

Updates an existing resource. You must instantiate the resource object with the specific resource type and number that will uniquely identify the resource being updated. The resource data is any collection of data that you wish to store as a Resource. It can be a character string, a structure, or any variable type. size indicates the number of bytes occupied by data.

Return

None

Example


void UpdateMyResource(const CTTable& hTable, ULONG type, ULONG number, pVOID data, VRLEN size)

{

CTResource* hRes = new CTResource(hTable, type, number);

try

{

hRes->Update(data, size);

}

catch (CTException &err)

{

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

}

delete hRes;

}

See Also

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

TOCIndex