CTResource::CTResource
CTResource constructor.
Declaration
CTResource(const CTTable& hTable);
CTResource(const CTTable& hTable, ULONG type, ULONG number);
CTResource(const CTTable& hTable, ULONG type, ULONG number, const CTString& name);
Description
CTResource constructor. The first constructor instantiate a resource object with the resource type and number set to zero and the resource name set to NULL. Set second overloaded constructor instantiate a resource object with a resource type and number, but the resource name set to NULL. The last overloaded constructor instantiate a resource object setting the resource type, number and name.
Return
None
Example
void DisplayAllResources(const CTTable& hTable)
{
CTResource* hRes = new CTResource(hTable);
try
{
// get the first resource
if (hRes->First())
{
do
{
// display resource type, number and name
printf("Resource type: %u, number: %u",
hRes->GetType(), hRes->GetNumber());
}
while (hRes->Next());
}
}
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::SetData(), CTResource::Unlock(), CTResource::IsLocked()