visitor_email_address: rjl@zk3.dec.com
 wxWINDOWS+VERSION: 2.1.10
 
+DATE+FIXED: 12/01/2000
+DATE+IDENTIFIED: 12/01/2000
+DETAILS: When I try to Print or create
+wxPrintPreview object in the
+printing sample, it fails.
+The reason is the wxGetDefaultDeviceName
+function in file msw/dcprint.cpp. In line 253
+the memory is freed, and then
+the pointer to the freed memory
+is used.
+FIXED+BY: Alexey V. Exarevsky (patched into wxWin 12/1/2000 by JACS)
+IDENTIFIED+BY: Alexey V. Exarevsky
+PLATFORMS: wxMSW, compiled by VC++ 6.0
+SHORT+DESCRIPTION: Print/Print preveiw to default printer in NT
+Submit: Submit
+WORKAROUND: I have moved lines that free
+memory below the lines that
+use lpszDeviceName and 
+lpszPortName
+visitor_email_address: ave@relex.ru
+wxWINDOWS+VERSION: 2.1.11
+
 
 ---------------------------END OF BUGLIST-------------------------
 
 
        m_targetWindow->Refresh(); 
    
 #ifdef __WXMSW__
-   // Necessary?
-    UpdateWindow ((HWND) m_targetWindow->GetHWND());
+    // Necessary?
+    // UpdateWindow ((HWND) m_targetWindow->GetHWND());
 #endif
 #ifdef __WXMAC__
                m_targetWindow->MacUpdateImmediately() ;
 
         lpszDriverName = (LPSTR)lpDevNames + lpDevNames->wDriverOffset;
         lpszDeviceName = (LPSTR)lpDevNames + lpDevNames->wDeviceOffset;
         lpszPortName   = (LPSTR)lpDevNames + lpDevNames->wOutputOffset;
-        GlobalUnlock(pd.hDevNames);
-        GlobalFree(pd.hDevNames);
-        pd.hDevNames=NULL;
 
         deviceName = lpszDeviceName;
         portName = lpszPortName;
+
+        GlobalUnlock(pd.hDevNames);
+        GlobalFree(pd.hDevNames);
+        pd.hDevNames=NULL;
     }
 
     if (pd.hDevMode)
 
 
             m_filterIndex = (int)of.nFilterIndex - 1;
 
-            if ( of.nFileExtension && fileNameBuffer[ of.nFileExtension-1] != wxT('.') )
+            if ( !of.nFileExtension || (of.nFileExtension && fileNameBuffer[ of.nFileExtension-1] != wxT('.')) )
             {                                    // user has typed an filename
                 // without an extension: