C++ WINAPI-Problem
Verfasst: 2. Jul 2010, 20:18
Hallo Leute, ich habe mal versucht ein kleines WINAPI-Programm objektorientiert um zu setzen.
Dies kann ich auch ohne Probleme compilieren.
Allerdings blinkt das erstellte Fenster nur einmal kurz auf und dann beendet sich das Programm
durch auffangen von WM_DESTROY, obwohl ich diese MSG nirgends losschick.
Hat jemand eine Idee woran das liegen könnte?
Schonmal danke
mfg c_r_89
- Code: Alles auswählen
// .h
class CCALLBACK : public CCALLBACKQUIT, public CCALLBACKCREATE
{
public:
LRESULT m_LRRender(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
};
class CMAINCLASS : public CCALLBACK
{
private:
HWND hWnd;
MSG msg;
WNDCLASS wc;
public:
CMAINCLASS(void);
BOOL m_bCreate(int iCmdShow);
int m_iMsgLoop(void);
};
// .cpp
HINSTANCE g_hInst;
CMAINCLASS* CMainC;
MAIN_BEGIN // #define MAIN_BEGIN int WINAPI WinMain(...){
g_hInst = hInstance;
CMainC = new CMAINCLASS();
if(!CMainC->m_bCreate(iCmdShow))
{MessageBox(NULL, "Fehler", "Fehler", MB_OK); return 1;}
int iBack = CMainC->m_iMsgLoop();
delete CMainC;
return iBack;
MAIN_GET // #define MAIN_GET }LRESULT CALLBACK WndProc(...){
return CMainC->m_LRRender(hWnd, message, wParam, lParam);
MAIN_END // #define MAIN_END }
Dies kann ich auch ohne Probleme compilieren.
Allerdings blinkt das erstellte Fenster nur einmal kurz auf und dann beendet sich das Programm
durch auffangen von WM_DESTROY, obwohl ich diese MSG nirgends losschick.
Hat jemand eine Idee woran das liegen könnte?
Schonmal danke
mfg c_r_89