Archived

This topic is now archived and is closed to further replies.

What Else?

This topic is 5279 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Heres my code from CApplication.h:

#ifndef CAPPLICATION_H
#define CAPPLICATION_H

#include "CMessageHandler.h"

class CApplication: public CMessageHandler
{
private:
static CApplication* s_pTheApplication;
static HINSTANCE s_hInstance;
public:
CApplication();
virtual ~CApplication();
static HINSTANCE GetHINSTANCE();
virtual bool OnInit()=0;
virtual void OnIdle()=0;
virtual void OnTerminate()=0;
static int Execut(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd);
static CApplication* GetApplication();
}

#endif

CMessageHandler.h:

#ifndef CMESSAGEHANDLER_H
#define CMESSAGEHANDLER_H

class CMessageHandler
{
private:
CMessageHandler* m_pmhParent;
public:
CMessageHandler(CMessageHandler* pmhParent);
virtual ~CMessageHandler();
void SetMessageParent(CMessageHandler* pmhParent);
CMessageHandler* GetMessageParent();
bool HandleMessages(int MessageID, int argc, void* argv[]);
virtual bool OnMessage(int MessageID, int argc, void* argv[]=0);
};

#endif

and CEventHandler.h:

#ifndef CEVENTHANDLER_H
#define CEVENTHANDLER_H

#include "CMessageHandler.h"

class CEventHandler: public CMessageHandler
{
private:
static ATOM s_WndCls;
HWND mhWnd;
public:
CEventHandler(CMessageHandler* pmhParent);
~CEventHandler();
operator HWND();
HWND GetHWND();
void SetHWND(HWND hWnd);
virtual bool HandleEvent(UINT uMsg, WPARAM wParam, LPARAM lParam);
virtual bool OnEvent(UINT uMsg, WPARAM wParam, LPARAM lParam);
virtual bool OnMouseMove(int ix, int iy, bool bShift, bool bControl, bool bLeft, bool Right, bool bMiddle);
virtual bool OnLButtonDown(int ix, int iy, bool bShift, bool bControl, bool bLeft, bool Right, bool bMiddle);
virtual bool OnLButtonUp(int ix, int iy, bool bShift, bool bControl, bool bLeft, bool Right, bool bMiddle);
virtual bool OnRButtonDown(int ix, int iy, bool bShift, bool bControl, bool bLeft, bool Right, bool bMiddle);
virtual bool OnRButtonUp(int ix, int iy, bool bShift, bool bControl, bool bLeft, bool Right, bool bMiddle);
virtual bool OnKeyDown(int iVirtKey);
virtual bool OnKeyUp(int iVirtKey);
virtual bool OnChar(TCHAR tchCode);
virtual bool OnCreate();
virtual bool ONDestroy();
virtual bool OnPaint(HDC hdc, const PAINTSTRUCT* pPaintStruct);
static void CreateWindowClass();
static LRESULT CALLBACK WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
};

#endif


Im looking for any classes to add to it to make it a stronger, more flexible, all purpose Famework. Thank you, and i just need Ideas of what the classes should be, i want to write them myself. Thank you again!

Quantum

Share this post


Link to post
Share on other sites