CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    May 2006
    Posts
    2

    Unhappy WTL::CReBarCtrlT

    Hello, I use this code:
    Code:
    CReBarCtrlT<CWindow> m_wndReBar;
    HWND m_hWndRB = m_wndReBar.Create(m_hWnd, NULL, NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, WS_EX_TOOLWINDOW);
    and I don't understand why the Create method returns NULL :-(

    May you help me pls?

  2. #2
    Join Date
    Jul 2001
    Location
    Netherlands
    Posts
    751

    Re: WTL::CReBarCtrlT

    You can use GetLastError() to find out more about what went wrong.

  3. #3
    Join Date
    May 2006
    Posts
    2

    Re: WTL::CReBarCtrlT

    ERROR_CANNOT_FIND_WND_CLASS
    1407 Cannot find window class.




    This is definition of used Create method:
    Code:
    HWND Create(HWND hWndParent, ATL::_U_RECT rect = NULL, LPCTSTR szWindowName = NULL,
    			DWORD dwStyle = 0, DWORD dwExStyle = 0,
    			ATL::_U_MENUorID MenuOrID = 0U, LPVOID lpCreateParam = NULL)
    	{
    		return TBase::Create(GetWndClassName(), hWndParent, rect.m_lpRect, szWindowName, dwStyle, dwExStyle, MenuOrID.m_hMenu, lpCreateParam);
    	}
    This is definition of GetWndClassName method:
    Code:
    static LPCTSTR GetWndClassName()
    	{
    		return REBARCLASSNAME;
    	}
    And this is definition of REBARCLASSNAME macro:
    Code:
    #ifdef _WIN32
    #define REBARCLASSNAMEW         L"ReBarWindow32"
    #define REBARCLASSNAMEA         "ReBarWindow32"
    
    #ifdef  UNICODE
    #define REBARCLASSNAME          REBARCLASSNAMEW
    #else
    #define REBARCLASSNAME          REBARCLASSNAMEA
    #endif
    
    #else
    #define REBARCLASSNAME          "ReBarWindow"
    #endif
    So I really don't know how to fix it :-( , because it looks I didn't make any mistake, did I?
    Last edited by Zitmen; April 9th, 2007 at 03:51 PM.

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