This is used to add a new resource to a resource file. More...
Functions | |
StatusInt | mdlResource_addByAlias (RscFileHandle rfHandle, RscType typeId, RscId rscId, void *pRsc, size_t rscSize, WCharCP pAlias) |
StatusInt | mdlResource_changeAlias (RscFileHandle rfHandle, RscType typeId, RscId rscId, WCharCP pAlias) |
Allows an application assign a new alias name to a resource. More... | |
StatusInt | mdlResource_createFileForPlatform (WCharCP pFilename, CharCP pIdent, UInt32 version, UInt32 platformId) |
This is used to generate a new resource file. More... | |
StatusInt | mdlResource_directAdd (RscFileHandle rfHandle, RscType typeId, RscId rscId, WCharCP pAlias, RscDirectAccess *pDirect) |
Gives the MDL programmer full control of writing resources to a resource file. More... | |
StatusInt | mdlResource_directAddComplete () |
Use this function to inform the resource manager that a new resource was added with mdlResource_directAdd. More... | |
StatusInt | mdlResource_getRscIdByAlias (RscId *pRscId, RscFileHandle rfHandle, RscType typeId, WCharCP pAlias) |
Obtains a resource's identification number from its ASCII alias name. More... | |
StatusInt | mdlResource_queryFile (UInt32 *pReturnValue, WCharCP pFilename, long queryId) |
Queries the resource manager for information regarding a resource file. More... | |
void * | mdlResource_resize (void *pResource, size_t newSize) |
Adjusts the size of a resource in a file. More... | |
StatusInt | mdlResource_add (RscFileHandle rfHandle, RscType typeId, RscId rscId, void *pRsc, size_t rscSize, WCharCP pAlias) |
Used to add a new resource to a resource file. More... | |
void | mdlResource_closeFile (RscFileHandle rfHandle) |
Closes a resource file. More... | |
StatusInt | mdlResource_createFile (WCharCP pFilename, CharCP pIdent, UInt32 version) |
Used to generate a new resource file. More... | |
StatusInt | mdlResource_delete (RscFileHandle rfHandle, RscType typeId, RscId rscId) |
Deletes a resource with a given resource ID from a resource file. More... | |
StatusInt | mdlResource_deleteByAlias (RscFileHandle rfHandle, RscType typeId, RscId rscId, WCharCP pAlias) |
Deletes a resource with a given resource ID from a resource file. More... | |
long | mdlResource_directLoad (RscFileHandle rfHandle, RscType typeId, RscId rscId, RscDirectAccess *pDirect) |
Allow the application control of resource loading. More... | |
StatusInt | mdlResource_free (void *pResource) |
Removes a resource from memory. More... | |
void * | mdlResource_load (RscFileHandle rfHandle, RscType typeId, RscId rscId) |
Used to load resources from an opened resource file. More... | |
void * | mdlResource_loadByAlias (RscFileHandle rfHandle, RscType typeId, RscId rscId, WCharCP pAlias) |
Used to load resources from an opened resource file. More... | |
StatusInt | mdlResource_openFile (RscFileHandle *pRfHandle, WCharCP pFileName, UInt32 fileAttributes) |
Opens a resource file, making its contents available to the application using subsequent mdlResource_... More... | |
StatusInt | mdlResource_query (void *pReturnValue, void *pResource, long queryId) |
Queries the resource manager for information regarding a resource. More... | |
StatusInt | mdlResource_queryClass (void *pReturnValue, RscFileHandle rfHandle, RscType typeId, long queryId, void *pArg) |
Queries the resource manager for information regarding a resourceclass. More... | |
StatusInt | mdlResource_queryClassByAlias (void *pReturnValue, RscFileHandle rfHandle, RscType typeId, long queryId, void *pArg, WCharCP pAlias) |
Queries the resource manager for information regarding a resourceclass. More... | |
StatusInt | mdlResource_write (void *pResource) |
Writes an updated resource (obtained with mdlResource_load) to its original position in the resource file from which it was loaded. More... | |
StatusInt | mdlResource_queryFileHandle (void *pReturnValue, long retValSize, RscFileHandle rfHandle, long queryId, void *pArg) |
Queries the resource manager for information regarding an open resource file (or files). More... | |
END_EXTERN_C StatusInt | mdlResource_loadWString (WStringR outString, RscFileHandle rfHandle, UInt32 listId, UInt32 stringNum, MdlDesc *m=NULL) |
Copies the wide character string identified by listId and stringNum into the WString referenced by outString. More... | |
StatusInt | mdlResource_loadWString (WStringP, RscFileHandle rfHandle, UInt32 listId2, UInt32 stringNum, MdlDesc *m=NULL) |
This version of mdlResource_loadWString allows the caller to pass a pointer to the output buffer, and the pointer may be NULL. More... | |
static RMGRSUBS_EXPORT StatusInt | AddByAlias (RscFileHandle rfHandle, RscType typeId, RscId rscId, void *pRsc, size_t rscSize, WCharCP pAlias) |
This is used to add a new resource to a resource file. More... | |
static RMGRSUBS_EXPORT StatusInt | ChangeAlias (RscFileHandle rfHandle, RscType typeId, RscId rscId, WCharCP pAlias) |
Allows an application assign a new alias name to a resource. More... | |
static RMGRSUBS_EXPORT StatusInt | CreateFileForPlatform (WCharCP pFilename, CharCP pIdent, UInt32 version, UInt32 platformId) |
This is used to generate a new resource file. More... | |
static RMGRSUBS_EXPORT StatusInt | DirectAdd (RscFileHandle rfHandle, RscType typeId, RscId rscId, WCharCP pAlias, RscDirectAccess *pDirect) |
Gives the MDL programmer full control of writing resources to a resource file. More... | |
static RMGRSUBS_EXPORT StatusInt | DirectAddComplete (void) |
Use this function to inform the resource manager that a new resource was added with RmgrResource::DirectAdd. More... | |
static RMGRSUBS_EXPORT StatusInt | GetRscIdByAlias (RscId *pRscId, RscFileHandle rfHandle, RscType typeId, WCharCP pAlias) |
Obtains a resource's identification number from its ASCII alias name. More... | |
static RMGRSUBS_EXPORT StatusInt | QueryFile (UInt32 *pReturnValue, WCharCP pFilename, long queryId) |
Queries the resource manager for information regarding a resource file. More... | |
static RMGRSUBS_EXPORT void * | Resize (void *pResource, size_t newSize) |
Adjusts the size of a resource in a file. More... | |
static RMGRSUBS_EXPORT StatusInt | Add (RscFileHandle rfHandle, RscType typeId, RscId rscId, void *pRsc, size_t rscSize, WCharCP pAlias) |
Used to add a new resource to a resource file. More... | |
static RMGRSUBS_EXPORT void | CloseFile (RscFileHandle rfHandle) |
Closes a resource file. More... | |
static RMGRSUBS_EXPORT StatusInt | CreateResourceFile (WCharCP pFilename, CharCP pIdent, UInt32 version) |
Used to generate a new resource file. More... | |
static RMGRSUBS_EXPORT StatusInt | Delete (RscFileHandle rfHandle, RscType typeId, RscId rscId) |
Deletes a resource with a given resource ID from a resource file. More... | |
static RMGRSUBS_EXPORT StatusInt | DeleteByAlias (RscFileHandle rfHandle, RscType typeId, RscId rscId, WCharCP pAlias) |
Deletes a resource with a given resource ID from a resource file. More... | |
static RMGRSUBS_EXPORT long | DirectLoad (RscFileHandle rfHandle, RscType typeId, RscId rscId, RscDirectAccess *pDirect) |
Allow the application control of resource loading. More... | |
static RMGRSUBS_EXPORT StatusInt | Free (void *pResource) |
Removes a resource from memory. More... | |
static RMGRSUBS_EXPORT void * | Load (RscFileHandle rfHandle, RscType typeId, RscId rscId) |
Used to load resources from an opened resource file. More... | |
static RMGRSUBS_EXPORT void * | LoadByAlias (RscFileHandle rfHandle, RscType typeId, RscId rscId, WCharCP pAlias) |
Used to load resources from an opened resource file. More... | |
static RMGRSUBS_EXPORT StatusInt | OpenFile (RscFileHandle *pRfHandle, WCharCP pFileName, UInt32 fileAttributes) |
Opens a resource file, making its contents available to the application using subsequent mdlResource_... More... | |
static RMGRSUBS_EXPORT StatusInt | Query (void *pReturnValue, void *pResource, long queryId) |
Queries the resource manager for information regarding a resource. More... | |
static RMGRSUBS_EXPORT StatusInt | QueryClass (void *pReturnValue, RscFileHandle rfHandle, RscType typeId, long queryId, void *pArg) |
Queries the resource manager for information regarding a resourceclass. More... | |
static RMGRSUBS_EXPORT StatusInt | QueryClassByAlias (void *pReturnValue, RscFileHandle rfHandle, RscType typeId, long queryId, void *pArg, WCharCP pAlias) |
Queries the resource manager for information regarding a resourceclass. More... | |
static RMGRSUBS_EXPORT StatusInt | Write (void *pResource) |
Writes an updated resource (obtained with RmgrResource::Load) to its original position in the resource file from which it was loaded. More... | |
static RMGRSUBS_EXPORT StatusInt | QueryFileHandle (void *pReturnValue, long retValSize, RscFileHandle rfHandle, long queryId, void *pArg) |
Queries the resource manager for information regarding an open resource file (or files). More... | |
static RMGRSUBS_EXPORT StatusInt | QueryFileName (WStringR fileName, RscFileHandle rfHandle) |
Queries the resource manager for the file name for an open resource file. More... | |
static RMGRSUBS_EXPORT StatusInt | LoadWString (WStringR outString, RscFileHandle rfHandle, UInt32 listId, UInt32 stringNum, MdlDesc *mdlDesc=NULL) |
Copies the wide character string identified by listId and stringNum into the WString referenced by outString. More... | |
This is used to add a new resource to a resource file.
[in] | rfHandle | Is the resource file handle for the file where the new resource will be written. rfHandle is obtained from the mdlResource_openFile function. |
[in] | typeId | Specifies the new resource's type or class. |
[in] | rscId | Uniquely identifies a resource within its class. If a resource of the specified resourceclass and resourceID already exists, the request to add the new resource is rejected. |
[in] | pRsc | Points to a block of memory to be added to the file as a resource. |
[in] | rscSize | Is the size of the block of memory pointed to by resource. |
[in] | pAlias | Is the alias name of the new resource. If no name is needed, alias is NULL. If a resource of the specified resourceclass and alias already exists, the request to add the new resource is rejected. |
Value | Description |
---|---|
MDLERR_RSCWRITEVIOLATION | The resource file was opened as RSC_READONLY. |
MDLERR_RSCALREADYEXISTS | resourceID or alias already exists in the file. In the case of mdlResource_addByAlias, resourceID and alias already exist as a pair on a resource. |
MDLERR_RSCFILEERROR | Error encountered while reading the resource file header. |
MDLERR_RSCWRITEERROR | Error encountered while writing to the file. |
MDLERR_RSCINSFMEM | Memory is insufficient to process the request. |
MDLERR_DATADEFNOTFOUND | Could not find a data definition corresponding to the resourceclass. |
|
static |
Used to add a new resource to a resource file.
[in] | rfHandle | Is the resource file handle for the file where the new resource will be written. rfHandle is obtained from the RmgrResource::OpenFile function. |
[in] | typeId | Specifies the new resource's type or class. |
[in] | rscId | Uniquely identifies a resource within its class. If a resource of the specified resourceclass and resourceID already exists, the request to add the new resource is rejected. |
[in] | pRsc | Points to a block of memory to be added to the fileas a resource. |
[in] | rscSize | Is the size of the block of memory pointed to by resource. |
[in] | pAlias | Is the alias name of the new resource. If no name is needed, alias is NULL. If a resource of the specified resourceclass and alias already exists, the request to add the new resource is rejected. |
Value | Description |
---|---|
MDLERR_RSCWRITEVIOLATION | The resource file was opened as RSC_READONLY. |
MDLERR_RSCALREADYEXISTS | resourceID or alias already exists in the file. In the case of RmgrResource::AddByAlias, resourceID and alias already exist as a pair on a resource. |
MDLERR_RSCFILEERROR | Error encountered while reading the resource file header. |
MDLERR_RSCWRITEERROR | Error encountered while writing to the file. |
MDLERR_RSCINSFMEM | Memory is insufficient to process the request. |
MDLERR_DATADEFNOTFOUND | Could not find a data definition corresponding to the resourceclass. |
|
static |
This is used to add a new resource to a resource file.
[in] | rfHandle | Is the resource file handle for the file where the new resource will be written. rfHandle is obtained from the RmgrResource::OpenFile function. |
[in] | typeId | Specifies the new resource's type or class. |
[in] | rscId | Uniquely identifies a resource within its class. If a resource of the specified resourceclass and resourceID already exists, the request to add the new resource is rejected. |
[in] | pRsc | Points to a block of memory to be added to the file as a resource. |
[in] | rscSize | Is the size of the block of memory pointed to by resource. |
[in] | pAlias | Is the alias name of the new resource. If no name is needed, alias is NULL. If a resource of the specified resourceclass and alias already exists, the request to add the new resource is rejected. |
Value | Description |
---|---|
MDLERR_RSCWRITEVIOLATION | The resource file was opened as RSC_READONLY. |
MDLERR_RSCALREADYEXISTS | resourceID or alias already exists in the file. In the case of RmgrResource::AddByAlias, resourceID and alias already exist as a pair on a resource. |
MDLERR_RSCFILEERROR | Error encountered while reading the resource file header. |
MDLERR_RSCWRITEERROR | Error encountered while writing to the file. |
MDLERR_RSCINSFMEM | Memory is insufficient to process the request. |
MDLERR_DATADEFNOTFOUND | Could not find a data definition corresponding to the resourceclass. |
|
static |
Allows an application assign a new alias name to a resource.
[in] | rfHandle | Is the resource file handle of the file containing the resource whose alias name will be changed. If rfHandle equals zero, the resource manager will check all resource files currently opened by the application. |
[in] | typeId | Identifies the class of the resource whose alias name will be changed. |
[in] | rscId | Identifies the resource whose alias name will be changed. |
[in] | pAlias | Points to the new ASCII alias name to be assigned to the resource. |
Value | Description |
---|---|
MDLERR_RSCWRITEVIOLATION | The resource file was opened as RSC_READONLY. |
MDLERR_RSCNOTFOUND | resourceID could not be found in the file(s). |
|
static |
Closes a resource file.
All resources currently in memory that were loaded from the file beingclosed are automatically freed.
[in] | rfHandle | Is the resource file handle corresponding to the file to close. rfHandle is originally obtained from the RmgrResource::OpenFile function. |
|
static |
This is used to generate a new resource file.
The resulting file must be opened with RmgrResource::OpenFile before new resources may be added to it.
[in] | pFilename | Is the name of the new resource file to be created. |
[in] | pIdent | Is an identity string containing up to 63 characters that is stored in the new resource file header. |
[in] | version | Is an application-defined 32-bit integer stored in the file header. |
[in] | platformId | Identifier used to identify one of the platforms supported by MicroStation. The valid platform identifiers are defined in basedefs.h. Only PLATFORM_PC_WINNT should be used for V8 and later versions. |
Value | Description |
---|---|
MDLERR_RSCFILEERROR | An undefined error was encountered. |
MDLERR_RSCINSFMEM | Memory is insufficient to create the file header. |
MDLERR_INVALIDPLATFORMID | Invalid platform identifier. |
|
static |
Used to generate a new resource file.
The resulting file must be opened with RmgrResource::OpenFile before new resources may be added to it.
[in] | pFilename | Is the name of the new resource file to be created. |
[in] | pIdent | Is an identity string containing up to 63 characters that is stored in the new resource file header. |
[in] | version | Is an application-defined 32-bit integer stored in the file header. |
Value | Description |
---|---|
MDLERR_RSCFILEERROR | An undefined error was encountered. |
MDLERR_RSCINSFMEM | Memory is insufficient to create the file header. |
MDLERR_INVALIDPLATFORMID | Invalid platform identifier. |
|
static |
Deletes a resource with a given resource ID from a resource file.
The RmgrResourceMT::DeleteByAlias function deletes a resource with a given resource ID and alias name from a resource file. The calling application must have opened a file containing the resource using the RmgrResource::OpenFile function. If the target resource is currently loaded by any application (including the calling application), the request is rejected. In this case, the resource must be freed using RmgrResource::Free before a subsequent delete request can be honored.
[in] | rfHandle | Is the resource file handle of the file wherethe resource will be deleted. rfHandle is obtained from the RmgrResource::OpenFile function. Passing zero for rfHandle is not allowed. |
[in] | typeId | Identifies the type of resource being deleted. |
[in] | rscId | Identifies the specific resource within the resourceclass to delete. |
Value | Description |
---|---|
MDLERR_RSCTYPEINVALID | Invalid resource type for the specified file. |
MDLERR_RSCWRITEVIOLATION | The resource file was opened as RSC_READONLY. |
MDLERR_RSCINUSE | The specified resource is loaded and in use; it cannot be deleted. |
MDLERR_RSCNOTFOUND | The specified resource could not be found in the resource file. |
|
static |
Deletes a resource with a given resource ID from a resource file.
The RmgrResourceMT::DeleteByAlias function deletes a resource with a given resource ID and alias name from a resource file. The calling application must have opened a file containing the resource using the RmgrResource::OpenFile function. If the target resource is currently loaded by any application (including the calling application), the request is rejected. In this case, the resource must be freed using RmgrResource::Free before a subsequent delete request can be honored.
[in] | rfHandle | Is the resource file handle of the file where the resource will be deleted. rfHandle is obtained from the RmgrResource::OpenFile function. Passing zero for rfHandle is not allowed. |
[in] | typeId | Identifies the type of resource being deleted. |
[in] | rscId | Identifies the specific resource within the resourceclass to delete |
[in] | pAlias | Only used with RmgrResourceMT::DeleteByAlias, is used along with resourceID to uniquely identify the resource to be deleted. |
Value | Description |
---|---|
MDLERR_RSCTYPEINVALID | Invalid resource type for the specified file. |
MDLERR_RSCWRITEVIOLATION | The resource file was opened as RSC_READONLY. |
MDLERR_RSCINUSE | The specified resource is loaded and in use; it cannot be deleted. |
MDLERR_RSCNOTFOUND | The specified resource could not be found in the resource file. |
|
static |
Gives the MDL programmer full control of writing resources to a
resource file.
Another routine for adding new resources, RmgrResource::Add, requires the resource (memory area) to exist in its entirety at the time it is added to the file. After calling RmgrResource::DirectAdd, however, the programmer can write the new resource to the file piece by piece as necessary using the fwrite C function. The size of the resulting resource is equal to the sum of the sizes of the fwrites and is computed when the programmer calls RmgrResource::DirectAddComplete.
[in] | rfHandle | Is the resource file handle of the file where the new resource will be written. rfHandle is obtained from the RmgrResource::OpenFile function. This parameter must be specified. (Zero is invalid.) | ||||||||||||||
[in] | typeId | Specifies the type or class of the new resource. | ||||||||||||||
[in] | rscId | Uniquely identifies a resource within its class. If a resource of the specified resourceclass and resourceID already exists, the request to add the new resource is rejected. | ||||||||||||||
[in] | pAlias | Is the alias name of the new resource. If no name is needed, alias is NULL. If a resource of the specified resourceclass and alias already exists, the request to add the new resource is rejected. | ||||||||||||||
[out] | pDirect | Points to the following structure (defined in the MDL system header file mdlerrs.r.h) to be filled in by RmgrResource::DirectAdd:
|
Value | Description |
---|---|
MDLERR_RSCWRITEVIOLATION | The resource file was opened as RSC_READONLY. |
MDLERR_RSCALREADYEXISTS | resourceID or alias already exists in the file. |
MDLERR_RSCFILE_ERROR | The resource file header cannot be read. |
MDLERR_RSCINSFMEM | Memory is insufficient to process the request. |
MDLERR_RSCERROR | NULL pointer for direct is invalid. |
MDLERR_RSCDIRECTADDPEND | A direct add is in progress. |
|
static |
Use this function to inform the resource manager that a new resource was
added with RmgrResource::DirectAdd.
Value | Description |
---|---|
MDLERR_RSCERROR | A direct add is not in progress. |
|
static |
Allow the application control of resource loading.
[in] | rfHandle | Is the resource file handle corresponding to a file that was opened using the RmgrResource::OpenFile function. If rfHandle equals zero, the resource manager will attempt to satisfy the request as it does with RmgrResource::Load. |
[in] | typeId | Identifies the type of resource being loaded |
[in] | rscId | Specifies the resource to load. |
[out] | pDirect | Information needed to access the resource directly |
Value | Description |
---|---|
MDLERR_RSCFILENOTFOUND | The resource file could not be found. |
MDLERR_RSCNOTFOUND | resourceID could not be found. |
|
static |
Removes a resource from memory.
The resource must have been loaded with the RmgrResource::Load function.
[in] | pResource | Points to a resource. |
Value | Description |
---|---|
MDLERR_RSCADDRINVALID | resource is an invalid resource pointer. |
|
static |
Obtains a resource's identification number from its ASCII alias name.
A resource's alias name can be a maximum of 16 characters and is assigned using the RmgrResource::Add, RmgrResource::DirectAdd or RmgrResource::ChangeAlias function.
[out] | pRscId | Points to an unsigned long where the ID of the resource with the matching alias name will be stored. |
[in] | rfHandle | Is the resource file handle of the file that will be checked for resourceclass and alias. If rfHandle equals zero, the resource manager will check all resource files currently opened by the application. |
[in] | typeId | Identifies the resource class that will be searched to find alias. |
[in] | pAlias | Points to the ASCII alias name associated with the resource whose identification number will be obtained. All resources of class resourceclass will be searched to find the matching alias. An alias name can be a maximum of 16 characters. |
Value | Description |
---|---|
MDLERR_RSCERROR | NULL is not a valid resourceID pointer. |
MDLERR_RSCNOTFOUND | alias could not be found in the resource file(s). |
|
static |
Used to load resources from an opened resource file.
[in] | rfHandle | Is the resource file handle corresponding to a file that was previously opened with the RmgrResource::OpenFile function. If rfHandle equals zero, the resource manager will attempt to satisfy the request in one of two ways. First, it will search for the specified resource in all resource files currently opened by the calling application. If that search fails, it will attempt to find the resource in the system resource files currently opened by MicroStation. In either case, the files are searched in last opened, first searched sequence. |
[in] | typeId | Identifies the class of the resource being loaded. |
[in] | rscId | Specifies the resource to load. |
Value | Description |
---|---|
MDLERR_RSCFILENOTFOUND | An undefined error was encountered. |
MDLERR_INSFMEMORY | Insufficient memory to load the resource. |
MDLERR_RSCTYPEINVALID | Invalid resource type for the file specified. |
MDLERR_RSCNOTFOUND | Cannot find the resource in the file specified. |
MDLERR_RSCFILEERROR | An undefined error was encountered while trying to read the resource from file. |
MDLERR_DATADEFNOTFOUND | Could not find a data definition with which to convert the resource to memory format. |
|
static |
Used to load resources from an opened resource file.
[in] | rfHandle | Is the resource file handle corresponding to a file that was previously opened with the RmgrResource::OpenFile function. If rfHandle equals zero, the resource manager will attempt to satisfy the request in one of two ways. First, it will search for the specified resource in all resource files currently opened by the calling application. If that search fails, it will attempt to find the resource in the system resource files currently opened by MicroStation. In either case, the files are searched in last opened, first searched sequence. |
[in] | typeId | Identifies the class of the resource being loaded. |
[in] | rscId | Specifies the resource to load. |
[in] | pAlias | Alias of resource to load |
Value | Description |
---|---|
MDLERR_RSCFILENOTFOUND | An undefined error was encountered. |
MDLERR_INSFMEMORY | Insufficient memory to load the resource. |
MDLERR_RSCTYPEINVALID | Invalid resource type for the file specified. |
MDLERR_RSCNOTFOUND | Cannot find the resource in the file specified. |
MDLERR_RSCFILEERROR | An undefined error was encountered while trying to read the resource from file. |
MDLERR_DATADEFNOTFOUND | Could not find a data definition with which to convert the resource to memory format. |
|
static |
Copies the wide character string identified by listId and stringNum into the WString referenced by outString.
[out] | outString | where the target string will be copied. If the function returns an error because the string could not be loaded, then outString is not set or cleared. |
[in] | rfHandle | Is the resource file handle corresponding to a file that was opened using the RmgrResource::OpenFile function. If rfHandle equals zero, the resource manager will attempt to satisfy the request as it does in RmgrResource::Load. |
[in] | listId | Is the resource ID of the string list containing the target string. |
[in] | stringNum | Specifies the string to load. |
[in] | mdlDesc | MdlDesc of the owning task of the resource |
Value | Description |
---|---|
MDLERR_RSCFILENOTFOUND | The resource file could not be found. |
MDLERR_RSCNOTFOUND | stringListID could not be found. |
StatusInt mdlResource_add | ( | RscFileHandle | rfHandle, |
RscType | typeId, | ||
RscId | rscId, | ||
void * | pRsc, | ||
size_t | rscSize, | ||
WCharCP | pAlias | ||
) |
Used to add a new resource to a resource file.
[in] | rfHandle | Is the resource file handle for the file where the new resource will be written. rfHandle is obtained from the mdlResource_openFile function. |
[in] | typeId | Specifies the new resource's type or class. |
[in] | rscId | Uniquely identifies a resource within its class. If a resource of the specified resourceclass and resourceID already exists, the request to add the new resource is rejected. |
[in] | pRsc | Points to a block of memory to be added to the fileas a resource. |
[in] | rscSize | Is the size of the block of memory pointed to by resource. |
[in] | pAlias | Is the alias name of the new resource. If no name is needed, alias is NULL. If a resource of the specified resourceclass and alias already exists, the request to add the new resource is rejected. |
Value | Description |
---|---|
MDLERR_RSCWRITEVIOLATION | The resource file was opened as RSC_READONLY. |
MDLERR_RSCALREADYEXISTS | resourceID or alias already exists in the file. In the case of mdlResource_addByAlias, resourceID and alias already exist as a pair on a resource. |
MDLERR_RSCFILEERROR | Error encountered while reading the resource file header. |
MDLERR_RSCWRITEERROR | Error encountered while writing to the file. |
MDLERR_RSCINSFMEM | Memory is insufficient to process the request. |
MDLERR_DATADEFNOTFOUND | Could not find a data definition corresponding to the resourceclass. |
StatusInt mdlResource_addByAlias | ( | RscFileHandle | rfHandle, |
RscType | typeId, | ||
RscId | rscId, | ||
void * | pRsc, | ||
size_t | rscSize, | ||
WCharCP | pAlias | ||
) |
StatusInt mdlResource_changeAlias | ( | RscFileHandle | rfHandle, |
RscType | typeId, | ||
RscId | rscId, | ||
WCharCP | pAlias | ||
) |
Allows an application assign a new alias name to a resource.
[in] | rfHandle | Is the resource file handle of the file containing the resource whose alias name will be changed. If rfHandle equals zero, the resource manager will check all resource files currently opened by the application. |
[in] | typeId | Identifies the class of the resource whose alias name will be changed. |
[in] | rscId | Identifies the resource whose alias name will be changed. |
[in] | pAlias | Points to the new ASCII alias name to be assigned to the resource. |
Value | Description |
---|---|
MDLERR_RSCWRITEVIOLATION | The resource file was opened as RSC_READONLY. |
MDLERR_RSCNOTFOUND | resourceID could not be found in the file(s). |
void mdlResource_closeFile | ( | RscFileHandle | rfHandle | ) |
Closes a resource file.
All resources currently in memory that were loaded from the file beingclosed are automatically freed.
[in] | rfHandle | Is the resource file handle corresponding to the file to close. rfHandle is originally obtained from the mdlResource_openFile function. |
StatusInt mdlResource_createFile | ( | WCharCP | pFilename, |
CharCP | pIdent, | ||
UInt32 | version | ||
) |
Used to generate a new resource file.
The resulting file must be opened with mdlResource_openFile before new resources may be added to it.
[in] | pFilename | Is the name of the new resource file to be created. |
[in] | pIdent | Is an identity string containing up to 63 characters that is stored in the new resource file header. |
[in] | version | Is an application-defined 32-bit integer stored in the file header. |
Value | Description |
---|---|
MDLERR_RSCFILEERROR | An undefined error was encountered. |
MDLERR_RSCINSFMEM | Memory is insufficient to create the file header. |
MDLERR_INVALIDPLATFORMID | Invalid platform identifier. |
StatusInt mdlResource_createFileForPlatform | ( | WCharCP | pFilename, |
CharCP | pIdent, | ||
UInt32 | version, | ||
UInt32 | platformId | ||
) |
This is used to generate a new resource file.
The resulting file must be opened with mdlResource_openFile before new resources may be added to it.
[in] | pFilename | Is the name of the new resource file to be created. |
[in] | pIdent | Is an identity string containing up to 63 characters that is stored in the new resource file header. |
[in] | version | Is an application-defined 32-bit integer stored in the file header. |
[in] | platformId | Identifier used to identify one of the platforms supported by MicroStation. The valid platform identifiers are defined in basedefs.h. Only PLATFORM_PC_WINNT should be used for V8 and later versions. |
Value | Description |
---|---|
MDLERR_RSCFILEERROR | An undefined error was encountered. |
MDLERR_RSCINSFMEM | Memory is insufficient to create the file header. |
MDLERR_INVALIDPLATFORMID | Invalid platform identifier. |
StatusInt mdlResource_delete | ( | RscFileHandle | rfHandle, |
RscType | typeId, | ||
RscId | rscId | ||
) |
Deletes a resource with a given resource ID from a resource file.
The mdlResource_deleteByAlias function deletes a resource with a given resource ID and alias name from a resource file. The calling application must have opened a file containing the resource using the mdlResource_openFile function. If the target resource is currently loaded by any application (including the calling application), the request is rejected. In this case, the resource must be freed using mdlResource_free before a subsequent delete request can be honored.
[in] | rfHandle | Is the resource file handle of the file wherethe resource will be deleted. rfHandle is obtained from the mdlResource_openFile function. Passing zero for rfHandle is not allowed. |
[in] | typeId | Identifies the type of resource being deleted. |
[in] | rscId | Identifies the specific resource within the resourceclass to delete. |
Value | Description |
---|---|
MDLERR_RSCTYPEINVALID | Invalid resource type for the specified file. |
MDLERR_RSCWRITEVIOLATION | The resource file was opened as RSC_READONLY. |
MDLERR_RSCINUSE | The specified resource is loaded and in use; it cannot be deleted. |
MDLERR_RSCNOTFOUND | The specified resource could not be found in the resource file. |
StatusInt mdlResource_deleteByAlias | ( | RscFileHandle | rfHandle, |
RscType | typeId, | ||
RscId | rscId, | ||
WCharCP | pAlias | ||
) |
Deletes a resource with a given resource ID from a resource file.
The mdlResource_deleteByAlias function deletes a resource with a given resource ID and alias name from a resource file. The calling application must have opened a file containing the resource using the mdlResource_openFile function. If the target resource is currently loaded by any application (including the calling application), the request is rejected. In this case, the resource must be freed using mdlResource_free before a subsequent delete request can be honored.
[in] | rfHandle | Is the resource file handle of the file where the resource will be deleted. rfHandle is obtained from the mdlResource_openFile function. Passing zero for rfHandle is not allowed. |
[in] | typeId | Identifies the type of resource being deleted. |
[in] | rscId | Identifies the specific resource within the resourceclass to delete |
[in] | pAlias | Only used with mdlResource_deleteByAlias, is used along with resourceID to uniquely identify the resource to be deleted. |
Value | Description |
---|---|
MDLERR_RSCTYPEINVALID | Invalid resource type for the specified file. |
MDLERR_RSCWRITEVIOLATION | The resource file was opened as RSC_READONLY. |
MDLERR_RSCINUSE | The specified resource is loaded and in use; it cannot be deleted. |
MDLERR_RSCNOTFOUND | The specified resource could not be found in the resource file. |
StatusInt mdlResource_directAdd | ( | RscFileHandle | rfHandle, |
RscType | typeId, | ||
RscId | rscId, | ||
WCharCP | pAlias, | ||
RscDirectAccess * | pDirect | ||
) |
Gives the MDL programmer full control of writing resources to a
resource file.
Another routine for adding new resources, mdlResource_add, requires the resource (memory area) to exist in its entirety at the time it is added to the file. After calling mdlResource_directAdd, however, the programmer can write the new resource to the file piece by piece as necessary using the fwrite C function. The size of the resulting resource is equal to the sum of the sizes of the fwrites and is computed when the programmer calls mdlResource_directAddComplete.
[in] | rfHandle | Is the resource file handle of the file where the new resource will be written. rfHandle is obtained from the mdlResource_openFile function. This parameter must be specified. (Zero is invalid.) | ||||||||||||||
[in] | typeId | Specifies the type or class of the new resource. | ||||||||||||||
[in] | rscId | Uniquely identifies a resource within its class. If a resource of the specified resourceclass and resourceID already exists, the request to add the new resource is rejected. | ||||||||||||||
[in] | pAlias | Is the alias name of the new resource. If no name is needed, alias is NULL. If a resource of the specified resourceclass and alias already exists, the request to add the new resource is rejected. | ||||||||||||||
[out] | pDirect | Points to the following structure (defined in the MDL system header file mdlerrs.r.h) to be filled in by mdlResource_directAdd:
|
Value | Description |
---|---|
MDLERR_RSCWRITEVIOLATION | The resource file was opened as RSC_READONLY. |
MDLERR_RSCALREADYEXISTS | resourceID or alias already exists in the file. |
MDLERR_RSCFILE_ERROR | The resource file header cannot be read. |
MDLERR_RSCINSFMEM | Memory is insufficient to process the request. |
MDLERR_RSCERROR | NULL pointer for direct is invalid. |
MDLERR_RSCDIRECTADDPEND | A direct add is in progress. |
StatusInt mdlResource_directAddComplete | ( | ) |
Use this function to inform the resource manager that a new resource was
added with mdlResource_directAdd.
Value | Description |
---|---|
MDLERR_RSCERROR | A direct add is not in progress. |
long mdlResource_directLoad | ( | RscFileHandle | rfHandle, |
RscType | typeId, | ||
RscId | rscId, | ||
RscDirectAccess * | pDirect | ||
) |
Allow the application control of resource loading.
[in] | rfHandle | Is the resource file handle corresponding to a file that was opened using the mdlResource_openFile function. If rfHandle equals zero, the resource manager will attempt to satisfy the request as it does with mdlResource_load. |
[in] | typeId | Identifies the type of resource being loaded |
[in] | rscId | Specifies the resource to load. |
[out] | pDirect | Information needed to access the resource directly |
Value | Description |
---|---|
MDLERR_RSCFILENOTFOUND | The resource file could not be found. |
MDLERR_RSCNOTFOUND | resourceID could not be found. |
StatusInt mdlResource_free | ( | void * | pResource | ) |
Removes a resource from memory.
The resource must have been loaded with the mdlResource_load function.
[in] | pResource | Points to a resource. |
Value | Description |
---|---|
MDLERR_RSCADDRINVALID | resource is an invalid resource pointer. |
StatusInt mdlResource_getRscIdByAlias | ( | RscId * | pRscId, |
RscFileHandle | rfHandle, | ||
RscType | typeId, | ||
WCharCP | pAlias | ||
) |
Obtains a resource's identification number from its ASCII alias name.
A resource's alias name can be a maximum of 16 characters and is assigned using the mdlResource_add, mdlResource_directAdd or mdlResource_changeAlias function.
[out] | pRscId | Points to an unsigned long where the ID of the resource with the matching alias name will be stored. |
[in] | rfHandle | Is the resource file handle of the file that will be checked for resourceclass and alias. If rfHandle equals zero, the resource manager will check all resource files currently opened by the application. |
[in] | typeId | Identifies the resource class that will be searched to find alias. |
[in] | pAlias | Points to the ASCII alias name associated with the resource whose identification number will be obtained. All resources of class resourceclass will be searched to find the matching alias. An alias name can be a maximum of 16 characters. |
Value | Description |
---|---|
MDLERR_RSCERROR | NULL is not a valid resourceID pointer. |
MDLERR_RSCNOTFOUND | alias could not be found in the resource file(s). |
void* mdlResource_load | ( | RscFileHandle | rfHandle, |
RscType | typeId, | ||
RscId | rscId | ||
) |
Used to load resources from an opened resource file.
[in] | rfHandle | Is the resource file handle corresponding to a file that was previously opened with the mdlResource_openFile function. If rfHandle equals zero, the resource manager will attempt to satisfy the request in one of two ways. First, it will search for the specified resource in all resource files currently opened by the calling application. If that search fails, it will attempt to find the resource in the system resource files currently opened by MicroStation. In either case, the files are searched in last opened, first searched sequence. |
[in] | typeId | Identifies the class of the resource being loaded. |
[in] | rscId | Specifies the resource to load. |
Value | Description |
---|---|
MDLERR_RSCFILENOTFOUND | An undefined error was encountered. |
MDLERR_INSFMEMORY | Insufficient memory to load the resource. |
MDLERR_RSCTYPEINVALID | Invalid resource type for the file specified. |
MDLERR_RSCNOTFOUND | Cannot find the resource in the file specified. |
MDLERR_RSCFILEERROR | An undefined error was encountered while trying to read the resource from file. |
MDLERR_DATADEFNOTFOUND | Could not find a data definition with which to convert the resource to memory format. |
void* mdlResource_loadByAlias | ( | RscFileHandle | rfHandle, |
RscType | typeId, | ||
RscId | rscId, | ||
WCharCP | pAlias | ||
) |
Used to load resources from an opened resource file.
[in] | rfHandle | Is the resource file handle corresponding to a file that was previously opened with the mdlResource_openFile function. If rfHandle equals zero, the resource manager will attempt to satisfy the request in one of two ways. First, it will search for the specified resource in all resource files currently opened by the calling application. If that search fails, it will attempt to find the resource in the system resource files currently opened by MicroStation. In either case, the files are searched in last opened, first searched sequence. |
[in] | typeId | Identifies the class of the resource being loaded. |
[in] | rscId | Specifies the resource to load. |
[in] | pAlias | Alias of resource to load |
Value | Description |
---|---|
MDLERR_RSCFILENOTFOUND | An undefined error was encountered. |
MDLERR_INSFMEMORY | Insufficient memory to load the resource. |
MDLERR_RSCTYPEINVALID | Invalid resource type for the file specified. |
MDLERR_RSCNOTFOUND | Cannot find the resource in the file specified. |
MDLERR_RSCFILEERROR | An undefined error was encountered while trying to read the resource from file. |
MDLERR_DATADEFNOTFOUND | Could not find a data definition with which to convert the resource to memory format. |
END_EXTERN_C StatusInt mdlResource_loadWString | ( | WStringR | outString, |
RscFileHandle | rfHandle, | ||
UInt32 | listId, | ||
UInt32 | stringNum, | ||
MdlDesc * | m = NULL |
||
) |
Copies the wide character string identified by listId and stringNum into the WString referenced by outString.
[out] | outString | where the target string will be copied. If the function returns an error because the string could not be loaded, then outString is not set or cleared. |
[in] | rfHandle | Is the resource file handle corresponding to a file that was opened using the mdlResource_openFile function. If rfHandle equals zero, the resource manager will attempt to satisfy the request as it does in mdlResource_load. |
[in] | listId | Is the resource ID of the string list containing the target string. |
[in] | stringNum | Specifies the string to load. |
[in] | m | Client application. |
Value | Description |
---|---|
MDLERR_RSCFILENOTFOUND | The resource file could not be found. |
MDLERR_RSCNOTFOUND | stringListID could not be found. |
StatusInt mdlResource_loadWString | ( | WStringP | , |
RscFileHandle | rfHandle, | ||
UInt32 | listId2, | ||
UInt32 | stringNum, | ||
MdlDesc * | m = NULL |
||
) |
This version of mdlResource_loadWString allows the caller to pass a pointer to the output buffer, and the pointer may be NULL.
StatusInt mdlResource_openFile | ( | RscFileHandle * | pRfHandle, |
WCharCP | pFileName, | ||
UInt32 | fileAttributes | ||
) |
Opens a resource file, making its contents available to the application using subsequent mdlResource_...
function calls.
[out] | pRfHandle | Return resource file handle | ||||||||
[in] | pFileName | Specifies the target file to be opened. If the resource manager cannot find the file specified by fileName, it will search for the file in the path specified by the MS_RSRCPATH environment variable. If fileName is NULL, the resource manager will default to the calling application's original load file. | ||||||||
[in] | fileAttributes | Specifies file attributes to be assigned to the file such as the read/write capability. Each file attribute is specified as a bit mask. Several may be logically ORed together if more than one file attribute needs to be assigned. The valid file attribute masks, defined in rscdefs.r.h, are:
|
Value | Description |
---|---|
MDLERR_RSCFILENOTFOUND | fileName could not be found. |
StatusInt mdlResource_query | ( | void * | pReturnValue, |
void * | pResource, | ||
long | queryId | ||
) |
Queries the resource manager for information regarding a resource.
[out] | pReturnValue | Points to the location where the resource manager must place its answer to the request. The type of data that it points to depends on the query. | ||||||||||||||||
[in] | pResource | Points to a resource loaded with the mdlResource_load function. | ||||||||||||||||
[in] | queryId | Identifies the specific query request type. Valid request types are as follows:
|
Value | Description |
---|---|
MDLERR_RSCADDRINVALID | resource is an invalid resource pointer. |
MDLERR_RSCQRYIDINVALID | queryID is invalid. |
StatusInt mdlResource_queryClass | ( | void * | pReturnValue, |
RscFileHandle | rfHandle, | ||
RscType | typeId, | ||
long | queryId, | ||
void * | pArg | ||
) |
Queries the resource manager for information regarding a resourceclass.
The mdlResource_queryClassByAlias function has the same purpose except it allows the caller to limit the scope of the query to only reflect resources with a specific alias name, and it only honors the RSC_QRY_COUNT and RSC_QRY_ID query types.
[out] | pReturnValue | Points to the location where the resource manager must place its answer to the request. The type of data that it points to depends on the type of the query. | ||||||||||||||||||||||
[in] | rfHandle | Is the resource file handle of the file containing the resourceclass being queried. rfHandle is obtained from the mdlResource_openFile function. If rfHandle equals zero, all resource files currently opened by the application are checked. | ||||||||||||||||||||||
[in] | typeId | Identifies the type of resource being queried. | ||||||||||||||||||||||
[in] | queryId | Identifies the specific query request type. Valid request types are as follows:
| ||||||||||||||||||||||
[in] | pArg | Points to an optional argument whose value depends on the specific queryID as described above. |
Value | Description |
---|---|
MDLERR_RSCERROR | An undefined error was encountered. |
MDLERR_RSCQRYIDINVALID | queryID is invalid. |
StatusInt mdlResource_queryClassByAlias | ( | void * | pReturnValue, |
RscFileHandle | rfHandle, | ||
RscType | typeId, | ||
long | queryId, | ||
void * | pArg, | ||
WCharCP | pAlias | ||
) |
Queries the resource manager for information regarding a resourceclass.
This function has the same purpose except it allows the caller to limit the scope of the query to only reflect resources with a specific alias name, and it only honors the RSC_QRY_COUNT and RSC_QRY_ID query types.
[out] | pReturnValue | Points to the location where the resource manager must place its answer to the request. The type of data that it points to depends on the type of the query. | ||||||||||||||||||||||
[in] | rfHandle | Is the resource file handle of the file containing the resourceclass being queried. rfHandle is obtained from the mdlResource_openFile function. If rfHandle equals zero, all resource files currently opened by the application are checked. | ||||||||||||||||||||||
[in] | typeId | Identifies the type of resource being queried. | ||||||||||||||||||||||
[in] | queryId | Identifies the specific query request type. Valid request types are as follows:
| ||||||||||||||||||||||
[in] | pArg | Points to an optional argument whose value depends on the specific queryID as described above. | ||||||||||||||||||||||
[in] | pAlias | Only consider rscs with this alias. |
Value | <Description |
---|---|
MDLERR_RSCERROR | An undefined error was encountered. |
MDLERR_RSCQRYIDINVALID | queryID is invalid. |
StatusInt mdlResource_queryFile | ( | UInt32 * | pReturnValue, |
WCharCP | pFilename, | ||
long | queryId | ||
) |
Queries the resource manager for information regarding a resource file.
The resource manager will call mdlResource_openFile in order to gain access to the information. Afterwards, the file will be closed.
[out] | pReturnValue | Points to the location where the resource manager must place its answer to the request. The type of data that it points to depends on the type of the query. | ||||||||||
[in] | pFilename | Points to a NULL-terminated ASCII filename. | ||||||||||
[in] | queryId | Identifies the specific query request type. Valid request types are as follows:
|
Value | Description |
---|---|
MDLERR_RSCINSFMEM | Memory is insufficient to read the file's header. |
MDLERR_RSCFILEERROR | The resource file cannot be read. |
MDLERR_RSCQRYIDINVALID | queryID is invalid. |
StatusInt mdlResource_queryFileHandle | ( | void * | pReturnValue, |
long | retValSize, | ||
RscFileHandle | rfHandle, | ||
long | queryId, | ||
void * | pArg | ||
) |
Queries the resource manager for information regarding an open resource file (or files).
[out] | pReturnValue | Points to the location where the resource manager must place its answer to the request. The type of data that it points to depends on the type of the query. | ||||||||||||||||||||
[in] | retValSize | Indicates the size of the area pointed to by reply (in bytes). | ||||||||||||||||||||
[in] | rfHandle | Is a handle to the open resource file to be queried. rfHandle is ignored if queryID equals RSC_QRY_COUNT or RSC_QRY_FILEHANDLE. | ||||||||||||||||||||
[in] | queryId | Identifies the specific query request type. Valid request types are as follows:
| ||||||||||||||||||||
[in] | pArg | Is only used when queryID equals RSC_QRY_COUNT or RSC_QRY_FILEHANDLE. In these cases, optArg is the MDL descriptor of the task whose open files are being queried. Use the functions mdlSystem_findMdlDesc or mdlSystem_getCurrMdlDesc to obtain the MDL descriptor for a given task. |
Value | Description |
---|---|
MDLERR_RSCINSFMEM | Memory is insufficient to read the file's header. |
MDLERR_RSCFILEERROR | The resource file cannot be read. |
MDLERR_RSCQRYIDINVALID | queryID is invalid. |
void* mdlResource_resize | ( | void * | pResource, |
size_t | newSize | ||
) |
Adjusts the size of a resource in a file.
No application except the calling application can load the resource. If newSize is larger than the previous size of the resource, the existing resource is padded with zero bytes until its size reaches newSize bytes. On the other hand, if newSize is smaller than the original size of the resource, bytes in the resource above newSize are truncated. If the attempt to resize the resource is successful, a pointer to the newly allocated resource is returned and the previous pointer is no longer valid.
[in] | pResource | Points to a resource that was obtained in memory through the mdlResource_load function. |
[in] | newSize | Is the new size to be assigned to the resource. |
Value | Description |
---|---|
MDLERR_RSCWRITEVIOLATION | The resource file was opened as RSC_READONLY. |
MDLERR_RSCINUSE | The resource is being used by more than one application. |
MDLERR_RSCADDRINVALID | The resource pointer is invalid. |
MDLERR_RSCINSFMEM | Memory is insufficient to process the request. |
StatusInt mdlResource_write | ( | void * | pResource | ) |
Writes an updated resource (obtained with mdlResource_load) to its original position in the resource file from which it was loaded.
The size of the write is determined by the size of the resource.
[in] | pResource | Points to a resource obtained in memory through mdlResource_load. |
Value | Description |
---|---|
MDLERR_RSCWRITEVIOLATION | The resource file was opened as RSC_READONLY. |
MDLERR_RSCADDRINVALID | resource is an invalid resource pointer. |
MDLERR_RSCFILEERROR | An unrecoverable file error occurred. |
MDLERR_DATADEFNOTFOUND | Could not find a data definition with which to convert the resource to file format. |
|
static |
Opens a resource file, making its contents available to the application using subsequent mdlResource_...
function calls.
[out] | pRfHandle | Return resource file handle | ||||||||
[in] | pFileName | Specifies the target file to be opened. If the resource manager cannot find the file specified by fileName, it will search for the file in the path specified by the MS_RSRCPATH environment variable. If fileName is NULL, the resource manager will default to the calling application's original load file. | ||||||||
[in] | fileAttributes | Specifies file attributes to be assigned to the file such as the read/write capability. Each file attribute is specified as a bit mask. Several may be logically ORed together if more than one file attribute needs to be assigned. The valid file attribute masks, defined in rscdefs.r.h, are:
|
Value | Description |
---|---|
MDLERR_RSCFILENOTFOUND | fileName could not be found. |
|
static |
Queries the resource manager for information regarding a resource.
[out] | pReturnValue | Points to the location where the resource manager must place its answer to the request. The type of data that it points to depends on the query. | ||||||||||||||||
[in] | pResource | Points to a resource loaded with the RmgrResource::Load function. | ||||||||||||||||
[in] | queryId | Identifies the specific query request type. Valid request types are as follows:
|
Value | Description |
---|---|
MDLERR_RSCADDRINVALID | resource is an invalid resource pointer. |
MDLERR_RSCQRYIDINVALID | queryID is invalid. |
|
static |
Queries the resource manager for information regarding a resourceclass.
The RmgrResource::QueryClassByAlias function has the same purpose except it allows the caller to limit the scope of the query to only reflect resources with a specific alias name, and it only honors the RSC_QRY_COUNT and RSC_QRY_ID query types.
[out] | pReturnValue | Points to the location where the resource manager must place its answer to the request. The type of data that it points to depends on the type of the query. | ||||||||||||||||||||||
[in] | rfHandle | Is the resource file handle of the file containing the resourceclass being queried. rfHandle is obtained from the RmgrResource::OpenFile function. If rfHandle equals zero, all resource files currently opened by the application are checked. | ||||||||||||||||||||||
[in] | typeId | Identifies the type of resource being queried. | ||||||||||||||||||||||
[in] | queryId | Identifies the specific query request type. Valid request types are as follows:
| ||||||||||||||||||||||
[in] | pArg | Points to an optional argument whose value depends on the specific queryID as described above. |
Value | Description |
---|---|
MDLERR_RSCERROR | An undefined error was encountered. |
MDLERR_RSCQRYIDINVALID | queryID is invalid. |
|
static |
Queries the resource manager for information regarding a resourceclass.
This function has the same purpose except it allows the caller to limit the scope of the query to only reflect resources with a specific alias name, and it only honors the RSC_QRY_COUNT and RSC_QRY_ID query types.
[out] | pReturnValue | Points to the location where the resource manager must place its answer to the request. The type of data that it points to depends on the type of the query. | ||||||||||||||||||||||
[in] | rfHandle | Is the resource file handle of the file containing the resourceclass being queried. rfHandle is obtained from the RmgrResource::OpenFile function. If rfHandle equals zero, all resource files currently opened by the application are checked. | ||||||||||||||||||||||
[in] | typeId | Identifies the type of resource being queried. | ||||||||||||||||||||||
[in] | queryId | Identifies the specific query request type. Valid request types are as follows:
| ||||||||||||||||||||||
[in] | pArg | Points to an optional argument whose value depends on the specific queryID as described above. | ||||||||||||||||||||||
[in] | pAlias | Only consider rscs with this alias. |
Value | <Description |
---|---|
MDLERR_RSCERROR | An undefined error was encountered. |
MDLERR_RSCQRYIDINVALID | queryID is invalid. |
|
static |
Queries the resource manager for information regarding a resource file.
The resource manager will call RmgrResource::OpenFile in order to gain access to the information. Afterwards, the file will be closed.
[out] | pReturnValue | Points to the location where the resource manager must place its answer to the request. The type of data that it points to depends on the type of the query. | ||||||||||
[in] | pFilename | Points to a NULL-terminated ASCII filename. | ||||||||||
[in] | queryId | Identifies the specific query request type. Valid request types are as follows:
|
Value | Description |
---|---|
MDLERR_RSCINSFMEM | Memory is insufficient to read the file's header. |
MDLERR_RSCFILEERROR | The resource file cannot be read. |
MDLERR_RSCQRYIDINVALID | queryID is invalid. |
|
static |
Queries the resource manager for information regarding an open resource file (or files).
[out] | pReturnValue | Points to the location where the resource manager must place its answer to the request. The type of data that it points to depends on the type of the query. | ||||||||||||||||||||
[in] | retValSize | Indicates the size of the area pointed to by reply (in bytes). | ||||||||||||||||||||
[in] | rfHandle | Is a handle to the open resource file to be queried. rfHandle is ignored if queryID equals RSC_QRY_COUNT or RSC_QRY_FILEHANDLE. | ||||||||||||||||||||
[in] | queryId | Identifies the specific query request type. Valid request types are as follows:
| ||||||||||||||||||||
[in] | pArg | Is only used when queryID equals RSC_QRY_COUNT or RSC_QRY_FILEHANDLE. In these cases, optArg is the MDL descriptor of the task whose open files are being queried. Use the functions mdlSystem_findMdlDesc or mdlSystem_getCurrMdlDesc to obtain the MDL descriptor for a given task. |
Value | Description |
---|---|
MDLERR_RSCINSFMEM | Memory is insufficient to read the file's header. |
MDLERR_RSCFILEERROR | The resource file cannot be read. |
MDLERR_RSCQRYIDINVALID | queryID is invalid. |
|
static |
Queries the resource manager for the file name for an open resource file.
[out] | fileName | The name of the resource file. |
[in] | rfHandle | A handle to the resource to query. |
Value | Description |
---|---|
MDLERR_RSCINSFMEM | Memory is insufficient to read the file's header. |
MDLERR_RSCFILEERROR | The resource file cannot be read. |
+------------—+------------—+------------—+------------—+------------—+---—
|
static |
Adjusts the size of a resource in a file.
No application except the calling application can load the resource. If newSize is larger than the previous size of the resource, the existing resource is padded with zero bytes until its size reaches newSize bytes. On the other hand, if newSize is smaller than the original size of the resource, bytes in the resource above newSize are truncated. If the attempt to resize the resource is successful, a pointer to the newly allocated resource is returned and the previous pointer is no longer valid.
[in] | pResource | Points to a resource that was obtained in memory through the RmgrResource::Load function. |
[in] | newSize | Is the new size to be assigned to the resource. |
Value | Description |
---|---|
MDLERR_RSCWRITEVIOLATION | The resource file was opened as RSC_READONLY. |
MDLERR_RSCINUSE | The resource is being used by more than one application. |
MDLERR_RSCADDRINVALID | The resource pointer is invalid. |
MDLERR_RSCINSFMEM | Memory is insufficient to process the request. |
|
static |
Writes an updated resource (obtained with RmgrResource::Load) to its original position in the resource file from which it was loaded.
The size of the write is determined by the size of the resource.
[in] | pResource | Points to a resource obtained in memory through RmgrResource::Load. |
Value | Description |
---|---|
MDLERR_RSCWRITEVIOLATION | The resource file was opened as RSC_READONLY. |
MDLERR_RSCADDRINVALID | resource is an invalid resource pointer. |
MDLERR_RSCFILEERROR | An unrecoverable file error occurred. |
MDLERR_DATADEFNOTFOUND | Could not find a data definition with which to convert the resource to file format. |