HandleToStrInChunks
Extract a VB string from the global memory handle.
BOOL HandleToStrInChunks(string, length, hMem, ChunkPos, ChunkLen)
char huge *string; | pointer to a visual basic string |
long length; | length of the global memory handle buffer |
HGLOBAL hMem; | Global memory handle |
long ChunkPos; | beginning position of the string to extract. This value must be between 0 to (length-1). |
long ChunkPos; | Length of the string to extract. |
Description: This function can be used to copy the contents of a part of the global memory handle to a given visual basic string. The calling routine must expand the string to appropriate length before calling this function. The following example extracts two 100 byte chunks from the beginning of the global memory handle.
ChunkLen = 100
ChunkPos = 0
string=space(ChunkLen)
HandleToStrInChunks(string,hMemLen,hMem,ChunkPos,ChunkLen)
ChunkPos = ChunkPos + ChunkLen
HandleToStrInChunks(string,hMemLen,hMem,ChunkPos,ChunkLen)
The input global memory handle is freed up when the last chunk is extracted.
Return Value: This function returns TRUE if successful.