[Classes] [Prev] [Next] [Methods]

CResourceMgr

Methods Index

Heritage
Description
Usage
Protected Data Members
Public Methods
Constructor and Destructor
Resource Management Methods
Protected Methods
Copy and Assignment

CResourceMgr


Heritage

Superclass: CNotifier

Subclasses: None


Description

CResourceMgr is the XVT-Power++ resource manager. Resources are registered in the CResourceMgr list of resources, and can be queried using the CResourceMgr::Find method. There is only one instance of CResourceMgr. It is instantiated in the CGlobalLibClass constructor automatically called by the CApplication constructor. Because any member of CGlobalClassLib is freed when the application quits, resource related memory is also automatically released. In essence, CResourceMgr carries out automatic garbage collection.

To add a resource to CResourceMgr, a program first creates the resource, then inserts it using the CResourceMgr::Insert method. Typically this is done in the constructor of a CResource derived class. With XVT-Power++ 3.0, CResourceMgr manages two types of resources: windows and menubars. Windows are automatically registered in the CWindow constructor, which loads a window from resource file. Menus are automatically registered in the CMenuBar constructor.


Usage

CResourceMgr *theResMgr = G->GetResourceMgr();

CResource *theWinRes = new CResourceWindow(WIN_101);
CResource *theStrRes = nre CResourceStrings(FIRST_ID, LAST_ID);
//example of range

theResMgr->Insert(theWinRes);
theResMgr->Insert(theWinRes);

const RWOrdered *theResList = theResMgr->Find(FIRST_ID);
RWOrderedIterator doTo(theResList);
...

Protected Data Members

RWOrdered* itsResources; Collection of resources maintained by CResourceMgr


Public Methods

Constructor and Destructor

CResourceMgr(void);
virtual ~CResourceMgr(void);

Resource Management Methods

long Insert(CResource* theResource);
BOOLEAN Remove(long theId, BOOLEAN IsDelete=FALSE);
CResource* Find(long theId);
const RWOrdered* GetResources(void) const;

Protected Methods

Copy and Assignment

CResourceMgr(const CResourceMgr& theResourceMgr);
CResourceMgr& operator= (
const CResourceMgr& theResourceMgr);


[Classes] [Prev] [Next] [Methods]

support@xvt.com


Visit our online help desk for tech support

Copyright © 2009, Providence Software Solutions Inc. All rights reserved.