StrToHandleInChunks
Build a global memory buffer from the VB string chunks.
HANDLE StrToHandleInChunks(string, length,hMem,ChunkPos,ChunkLen)
BYTE huge *string; | pointer to a visual basic string |
long length; | Final length of the global memory handle |
HANDLE hMem; | The global memory handle being built. Set this value to 0 on the first call to this function. On the subsequent calls, set this value to the return value from the previous call to this function. |
long ChunkPos; | Position of the current chunk in the memory buffer. This value must be between 0 and (length-1). |
long ChunkLen; | Length of the chunk being added. |
Example:
The following code adds two 100 byte strings to build a memory
buffer.
BufferLen=200
ChunkLen = 100
ChunkPos =0
hMem=0
hMem=StrToHandleInChunks(string,200,hMem,ChunkPos,ChunkLen)
ChunkPos = ChunkPos + ChunkLen
hMem=StrToHandleInChunks(string,200,hMem,ChunkPos,ChunkLen)
Return Value: This function returns the global memory handle if successful. Otherwise it returns NULL.