CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Threaded View

  1. #1
    Join Date
    May 2006
    Location
    Ukraine
    Posts
    19

    Very simple GUI app with ATL

    My window application disappears just only this window appears. By another words it doesn't run the PreTranslate message cycle. It's my program's code:

    Code:
     #include <atlbase.h>
    #include <atlwin.h>
    #include <windows.h>
    #include <tchar.h>
    
    class CMainWindow : public CWindowImpl < CMainWindow, CWindow, CFrameWinTraits >
    {
    public:
    	CMainWindow()
    	{
    		Create(NULL, CWindow::rcDefault, _T("My ATL Window"));
    		ShowWindow(SW_SHOWNORMAL);
    	}
    	virtual ~CMainWindow()
    	{
    		if (m_hWnd) DestroyWindow();
    	}
    	BEGIN_MSG_MAP(CMainWindow)
    		MESSAGE_HANDLER(WM_PAINT, OnPaint)
    	END_MSG_MAP()
    public:
    	LRESULT CMainWindow::OnPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
    	{return 0;}
    }theApp;
    
    int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
    {
    	return 0;
    }
    Please, help me. What do I do wrong?
    Last edited by Siddhartha; May 22nd, 2006 at 12:09 PM. Reason: Added Code-Tags...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured