- wndclass.hCursor = ::LoadCursor((HINSTANCE)NULL, IDC_ARROW);
-
- // register the class for all normal windows and "no redraw" frames
- wndclass.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
- RegisterClassWithUniqueNames(wxT("wxWindowClass"),
- &wxCanvasClassName,
- &wxCanvasClassNameNR,
- &wndclass);
-
- // Register the MDI frame window class and "no redraw" MDI frame
- wndclass.hbrBackground = (HBRUSH)NULL; // paint MDI frame ourselves
- RegisterClassWithUniqueNames(wxT("wxMDIFrameClass"),
- &wxMDIFrameClassName,
- &wxMDIFrameClassNameNoRedraw,
- &wndclass);
-
- // Register the MDI child frame window class and "no redraw" MDI child frame
- wndclass.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
- RegisterClassWithUniqueNames(wxT("wxMDIChildFrameClass"),
- &wxMDIChildFrameClassName,
- &wxMDIChildFrameClassNameNoRedraw,
- &wndclass);
-
- return true;
-}
-
-// ---------------------------------------------------------------------------
-// UnregisterWindowClasses
-// ---------------------------------------------------------------------------
-
-// This function unregisters the class with the given name and frees memory
-// allocated for it by RegisterAndStoreClassName().
-static bool UnregisterAndFreeClassName(const wxChar **ppClassName)
-{
- bool retval = true;
-
- if ( !::UnregisterClass(*ppClassName, wxhInstance) )
+ wndclass.hCursor = ::LoadCursor(NULL, IDC_ARROW);
+ wndclass.hbrBackground = (HBRUSH)wxUIntToPtr(bgBrushCol + 1);
+ wndclass.style = CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS | extraStyles;
+
+
+ ClassRegInfo regClass;
+ regClass.basename = name;
+
+ // constuct a unique suffix to allow registering the class with the same
+ // base name in a main application using wxWidgets and a DLL using
+ // wxWidgets loaded into its address space: as gs_regClassesInfo variable
+ // is different in them, we're going to obtain a unique prefix by using its
+ // address here
+ regClass.regname = regClass.basename +
+ wxString::Format(wxT("@%p"), &gs_regClassesInfo);
+ wndclass.lpszClassName = regClass.regname.wx_str();
+ if ( !::RegisterClass(&wndclass) )