(in which case ListCtrl_SetBkColor fails because it's called with HWND = 0)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@481
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
#if defined(__WIN95__)
#include "wx/listctrl.h"
#if defined(__WIN95__)
#include "wx/listctrl.h"
#include "wx/msw/private.h"
#include "wx/msw/private.h"
m_textCtrl = NULL;
m_colCount = 0;
m_textCtrl = NULL;
m_colCount = 0;
- wxSystemSettings settings;
- SetBackgroundColour(settings.GetSystemColour(wxSYS_COLOUR_WINDOW));
- SetForegroundColour(parent->GetDefaultForegroundColour());
-
SetValidator(validator);
SetName(name);
SetValidator(validator);
SetName(name);
wstyle |= ConvertToMSWStyle(oldStyle, m_windowStyle);
// Create the ListView control.
wstyle |= ConvertToMSWStyle(oldStyle, m_windowStyle);
// Create the ListView control.
- HWND hWndListControl = CreateWindowEx(exStyle,
+ m_hWnd = (WXHWND)CreateWindowEx(exStyle,
(HWND) parent->GetHWND(),
(HMENU)m_windowId,
wxGetInstance(),
(HWND) parent->GetHWND(),
(HMENU)m_windowId,
wxGetInstance(),
+ NULL);
+
+ if ( !m_hWnd ) {
+ wxLogError("Can't create list control window.");
+
+ return FALSE;
+ }
+
+ wxSystemSettings settings;
+ SetBackgroundColour(settings.GetSystemColour(wxSYS_COLOUR_WINDOW));
+ SetForegroundColour(parent->GetDefaultForegroundColour());
- m_hWnd = (WXHWND) hWndListControl;
if (parent) parent->AddChild(this);
SubclassWin((WXHWND) m_hWnd);
if (parent) parent->AddChild(this);
SubclassWin((WXHWND) m_hWnd);