Click here to Skip to main content
15,925,723 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionCDHTMLDialog Scroll ? Pin
Matt Gates13-Oct-03 9:56
Matt Gates13-Oct-03 9:56 
AnswerRe: CDHTMLDialog Scroll ? Pin
Matt Gates14-Oct-03 14:43
Matt Gates14-Oct-03 14:43 
GeneralRe: CDHTMLDialog Scroll ? Pin
algol14-Oct-03 21:27
algol14-Oct-03 21:27 
GeneralRe: CDHTMLDialog Scroll ? Pin
Matt Gates15-Oct-03 3:27
Matt Gates15-Oct-03 3:27 
Generalsetup files in visual c++ Pin
sarasara098765413-Oct-03 9:39
sarasara098765413-Oct-03 9:39 
QuestionHow can I open and read PS/2 Port (Read Mouse data) Pin
asd175313-Oct-03 9:25
asd175313-Oct-03 9:25 
QuestionHow can I open and read PS/2 Port (Read Mouse data) Pin
asd175313-Oct-03 9:25
asd175313-Oct-03 9:25 
GeneralHelp me Pin
Tomas Wilhelmsson13-Oct-03 9:20
Tomas Wilhelmsson13-Oct-03 9:20 
Ok help me out here now ;>

First of all this is only a thought i had and if you think it's totaly stupid, please do say so if you wish :P

Ok, here is the deal.. Im planing on making a type of resource manager, all "resources" should inherit by a class "Resource" that also takes an templated argument for a type...

template <class Type>
class Resource
{
private:
Type *m_Res;

public:
Resource();
virtual ~Resource();

virtual Type * GetResource() { };
virtual operator=(const Type &t) { };
}; // Etc etc

And thus enabling the user to still overload everything given by the base class if it's need for it, so for a texture for instance.

class Texture : Resource<IDirect3DTexture9>
{
public:
int Width;
int Height;
// Etc...
private:
bool Load(string);
// and all the stuff connected to it.
};

and a material

class Material : Resource<D3DMATERIAL9>
{
private:
// lots of strange stuff
public:
// same here
};

So far, i like the model and how i can use it for most stuff that i could call a resource... but here comes the problem, as its templated i cant use the class "Resource" as a "base" class for casting, so in the resource manager i cant just make a std::list<Resource> l; and then push back whatever that comes from resource.

ex:

class ResourceManager
{
private:
std::list<Resource *> m_ResList;
public:
bool Add(Resource *res) {
m_ResList.push_back(res);
}
};

If anyone even takes time to read this post i am soooo wanting ideas about this. Anyone want to help making it maybe better? .. A better way to make it? .. want me to throw it out the window . .whatever as long as you understand what i want to make you are welcome to reply Poke tongue | ;-P

(Tired and dont even know how all that came out, if to many dont understand it just ignore it later Poke tongue | ;-P ... I hope someone does tho Poke tongue | ;-P
QuestionUpdateData into modeless dialog? Pin
andrzejf13-Oct-03 8:34
andrzejf13-Oct-03 8:34 
GeneralTrapping KeyBoard events Pin
act_x13-Oct-03 7:41
act_x13-Oct-03 7:41 
GeneralRe: Trapping KeyBoard events Pin
Phil Hamer13-Oct-03 10:55
Phil Hamer13-Oct-03 10:55 
GeneralHelp with WMI please Pin
corwin3213-Oct-03 7:19
corwin3213-Oct-03 7:19 
QuestionHow to close Modeless Dialog Pin
vancouver77713-Oct-03 6:57
vancouver77713-Oct-03 6:57 
AnswerRe: How to close Modeless Dialog Pin
vcplusplus13-Oct-03 7:32
vcplusplus13-Oct-03 7:32 
AnswerRe: How to close Modeless Dialog Pin
Jim Crafton13-Oct-03 7:50
Jim Crafton13-Oct-03 7:50 
Generalfile io Pin
Snyp13-Oct-03 6:55
Snyp13-Oct-03 6:55 
GeneralRe: file io Pin
David Crow13-Oct-03 7:57
David Crow13-Oct-03 7:57 
GeneralkeyBoard events Pin
act_x13-Oct-03 6:53
act_x13-Oct-03 6:53 
GeneralDisabling the tool bar button Pin
sanjay zore13-Oct-03 6:29
sanjay zore13-Oct-03 6:29 
GeneralRe: Disabling the tool bar button Pin
Mike Danberg13-Oct-03 8:26
Mike Danberg13-Oct-03 8:26 
GeneralDownload file from internet (http) Pin
Dominik Reichl13-Oct-03 6:26
Dominik Reichl13-Oct-03 6:26 
GeneralRe: Download file from internet (http) Pin
David Isla13-Oct-03 7:01
David Isla13-Oct-03 7:01 
GeneralRe: Download file from internet (http) Pin
Dominik Reichl13-Oct-03 8:16
Dominik Reichl13-Oct-03 8:16 
GeneralInternet from a Windows Service Pin
Bart13-Oct-03 5:25
Bart13-Oct-03 5:25 
GeneralWS_CLIPCHILDREN problem Pin
jmgir13-Oct-03 5:21
jmgir13-Oct-03 5:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.