Function _momResize() Foundation
Changes the size of a memory object.
XPPAPIRET _momResize(MomHandle mhObj, ULONG size);
Returns NULL when the size is successfully changed. Otherwise an error value is returned and the memory object retins its old size.
_momResize() is used to change the size of a memory object created with _momAlloc(). If the object is enlarged the previous content will be remained. The bytes added at the end of the object are not initialized. If the object is reduced in size, data bytes at the end of the object are truncated. The remainder of the content is unchanged.
/*
Create a memory object, then change its size
*/
#include "xppcon.h"
MomHandle hNew;
hNew = _momAlloc(10);
if (hNew != MOM_NULLHANDLE)
{
if (_momResize(hNew, 20) == 0)
{
/* ... operations with hNew */
}
else
{
/* ... error handling */
}
_momFree(hNew);
}
else
{
/* ... error handling */
}
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.