]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/cursor.cpp
wxRichTextCtrl::ApplyStyle now applies a paragraph style at the cursor
[wxWidgets.git] / src / msw / cursor.cpp
index fbcf62dd75eb14d145e72c83acab157ea3358ff8..bfa5771d24376db14d670c0a33870775bcd0aa91 100644 (file)
@@ -105,8 +105,7 @@ public:
 
     virtual void OnExit()
     {
-        delete gs_globalCursor;
-        gs_globalCursor = NULL;
+        wxDELETE(gs_globalCursor);
     }
 };
 
@@ -237,12 +236,12 @@ wxCursor::wxCursor(const wxString& filename,
     switch ( kind )
     {
         case wxBITMAP_TYPE_CUR_RESOURCE:
-            hcursor = ::LoadCursor(wxGetInstance(), filename.fn_str());
+            hcursor = ::LoadCursor(wxGetInstance(), filename.t_str());
             break;
 
 #ifndef __WXWINCE__
         case wxBITMAP_TYPE_CUR:
-            hcursor = ::LoadCursorFromFile(filename.fn_str());
+            hcursor = ::LoadCursorFromFile(filename.t_str());
             break;
 #endif
 
@@ -349,6 +348,15 @@ void wxCursor::InitFromStock(wxStockCursor idCursor)
 
     if ( !hcursor )
     {
+        if ( !stdCursor.isStd )
+        {
+            // it may be not obvious to the programmer why did loading fail,
+            // try to help by pointing to the by far the most probable reason
+            wxFAIL_MSG(wxT("Loading a cursor defined by wxWidgets failed, ")
+                       wxT("did you include include/wx/msw/wx.rc file from ")
+                       wxT("your resource file?"));
+        }
+
         wxLogLastError(wxT("LoadCursor"));
     }
     else