--- C:\usr\src\PyGUI-2.3\GUI\Win32\ScrollableViews.py	Fri Nov 13 08:21:50 2009
+++ .\ScrollableViews.py	Thu Oct 21 13:12:40 2010
@@ -18,8 +18,31 @@
 #  and doesn't provide any way of creating a real one without using
 #  a resource. The following hack creates something that looks enough
 #  like a CDocument to keep it happy.
-win_dummy_doc = ui.CreateRichEditView().GetDocument()
-#print "ScrollableViews: Created dummy doc"
+
+doctemp = None
+
+def GetDummyDoc():
+    app = ui.GetApp()
+    # we don't really want use MFC doc/view, only want a auto scrollwindow thing, but
+    # therefore we need a well established c++ doc template + dummy doc object
+    # otherwise pywin32 build 214 crashes
+    global doctemp
+    if not doctemp:
+        # we need a C++ doctemplate and AttachObject() to get a
+        # document to get a scrollwindow .. - oh god
+        from pywin.mfc import object
+        doctemp = ui.CreateDocTemplate(ui.IDR_PYTHONTYPE)  
+        doctemp = object.CmdTarget(doctemp)  # otherwise we crash at exit
+
+        # alternative, but draws in pythonwin framework
+        # because _SetupShared flaw still in docview (patch still not accepted!)
+#        from pywin.mfc import docview
+#        doctemp = docview.DocTemplate()
+
+#        app.AddDocTemplate(doctemp)
+
+    dummydoc = doctemp.DoCreateDoc()  
+    return dummydoc
 
 class ScrollableView(GScrollableView):
 
@@ -27,8 +50,8 @@
 
     def __init__(self, **kwds):
         kwds.setdefault('extent', default_extent)
-        win = ui.CreateView(win_dummy_doc)
-        win.CreateWindow(win_none, 0, win_style, (0, 0, 100, 100))
+        win = ui.CreateView(GetDummyDoc())
+        win.CreateWindow(win_none, ui.AFX_IDW_PANE_FIRST, win_style, (0, 0, 100, 100))
         GScrollableView.__init__(self, _win = win)
         self.set(**kwds)
 
