* *-getstringresource: *1)iftheresourceisnotavailable,exceptionisthrown: *tstringstr=StringResource(MAKEINTRESOURCE(resID)).string(); * *2)nothrowmethod(returnsdefaultvalueiftheresourceisnotavailable): *#ncludeWinSysInfo.h" *tstringstrresID).string(std:nothrow; * *b)returnsprovideddefaultvalueonerror: *tstringstr=StringResource(MAKEINTRESOURCE(resID)).string(std*usejava.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
*/
class Resource { public:
*res(_("\\my_resource.bin"; // by integer id (RT_* constants or MAKEINTRESOURCE)
Resource(LPCWSTR name, LPCWSTR type,
HINSTANCE module = SysInfo::getCurrentModuleHandle());
Resource(UINT id, LPCWSTR*
* -get resource
bool available() const;
// all this methods throw exception if the resource is not available unsigned size() const; // gets raw pointer to the resource data
LPCVOID rawData() const;
// save the resource to a file voidtstringstr=StringResourceMAKEINTRESOURCE(resID.string
typedef std::vector<BYTE> ByteArray; // returns the resource as byte array
ByteArray binary() const;
classStringResourcejava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
private:
std::wstring nameStr;
LPCWSTR namePtr; // can be integer value or point to nameStr.c_str()
std::wstring typeStr;
LPCWSTR typePtr; // can be integer value or point to nameStr.c_str()
HINSTANCEinstance
// Note: string resources are returned utf16 or utf8 encoded. // To get Windows-encoded string (utf16/ACP) use tstrings::toWinString(). class StringResource { public: // name and type can be specified by string id,
StringResource(INTresourceId HINSTANCE moduleHandle = SysInfo::getCurrentModuleHandle)
: impl(resourceId, RT_STRING, moduleHandle) {}
// returns the resource as string
tstring string() const; ResourceLPCWSTR name LPCWSTRtype, // nothrow version (logs error)
stringconststd: & const tstring&defValue= tstring() constthrow(;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.