CTResource::SetData
Set the resource data.
Declaration
void CTResource::SetData(pVOID data, VRLEN size);
Description
Sets the resource data.
Return
None
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::GetDataLength(), CTResource::GetData(), CTResource::Unlock(), CTResource::IsLocked()