]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/utils.cpp
SN: Added #pragma implementation needed by GCC - expect more to come
[wxWidgets.git] / src / msw / utils.cpp
index 53db01e6d8c48cb4fc503188580928be338fb5e0..d9996a0453d636a76e7a6ef6db905a99dd2bc275 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        mse/utils.cpp
+// Name:        msw/utils.cpp
 // Purpose:     Various utilities
 // Author:      Julian Smart
 // Modified by:
@@ -876,7 +876,14 @@ wxChar *wxLoadUserResource(const wxString& resourceName, const wxString& resourc
     if ( !theText )
         return NULL;
 
-    wxChar *s = copystring(theText);
+    // Not all compilers put a zero at the end of the resource (e.g. BC++ doesn't).
+    // so we need to find the length of the resource.
+    int len = ::SizeofResource(wxGetInstance(), hResource);
+    wxChar  *s = new wxChar[len+1];
+    wxStrncpy(s,theText,len);
+    s[len]=0;
+
+    // wxChar *s = copystring(theText);
 
     // Obsolete in WIN32
 #ifndef __WIN32__