Change wxMSW-specific wxLoadUserResource() to accept standard RT_XXX types.
Resource types can be either strings for custom types or integers casted to a TCHAR* for the standard ones. Using wxString for the resource type prevented us from using the latter as any attempt to initialize wxString for such a pseudo-string resulted in an immediate crash. Change wxLoadUserResource() resource type parameter type to wxChar* to avoid this and allow passing standard resource types, such as RT_RCDATE, to this function directly. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72472 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -818,6 +818,10 @@ WXDLLIMPEXP_CORE bool wxYieldIfNeeded();
|
||||
// Return the pointer to the resource data. This pointer is read-only, use
|
||||
// the overload below if you need to modify the data.
|
||||
//
|
||||
// Notice that the resource type can be either a real string or an integer
|
||||
// produced by MAKEINTRESOURCE(). In particular, any standard resource type,
|
||||
// i.e any RT_XXX constant, could be passed here.
|
||||
//
|
||||
// Returns true on success, false on failure. Doesn't log an error message
|
||||
// if the resource is not found (because this could be expected) but does
|
||||
// log one if any other error occurs.
|
||||
@@ -825,7 +829,7 @@ WXDLLIMPEXP_CORE bool wxYieldIfNeeded();
|
||||
wxLoadUserResource(const void **outData,
|
||||
size_t *outLen,
|
||||
const wxString& resourceName,
|
||||
const wxString& resourceType = wxUserResourceStr,
|
||||
const wxChar* resourceType = wxUserResourceStr,
|
||||
WXHINSTANCE module = 0);
|
||||
|
||||
// This function allocates a new buffer and makes a copy of the resource
|
||||
@@ -835,7 +839,7 @@ WXDLLIMPEXP_CORE bool wxYieldIfNeeded();
|
||||
// Returns NULL on failure.
|
||||
WXDLLIMPEXP_BASE char*
|
||||
wxLoadUserResource(const wxString& resourceName,
|
||||
const wxString& resourceType = wxUserResourceStr,
|
||||
const wxChar* resourceType = wxUserResourceStr,
|
||||
int* pLen = NULL,
|
||||
WXHINSTANCE module = 0);
|
||||
#endif // __WINDOWS__
|
||||
|
Reference in New Issue
Block a user