Technically, that's inaccurate.... as documented under GLOBALMEM ALLOC.:
GLOBALMEM ALLOC
A moveable memory block of the size in bytes specified by count is allocated. A unique handle is assigned to this memory object (for later identification). This handle is assigned to the LONG or DWORD variable specified by vHndl. If the requested allocation fails for any reason, the value zero (0) is assigned to vHndl instead.
A moveable memory block of the size in bytes specified by count is allocated. A unique handle is assigned to this memory object (for later identification). This handle is assigned to the LONG or DWORD variable specified by vHndl. If the requested allocation fails for any reason, the value zero (0) is assigned to vHndl instead.
So I should have said ,
"When GLOBALMEM ALLOC returns a handle, it has meaning ONLY to other GLOBALMEM statements in the same code module."
Unless of course the compiler publisher forgot to tell us the GLOBALMEM ALLOC statement returns a WINDOWS-USABLE global memory handle. If this were the case then the handle could be passed as a parameter to a function in another code module.
MCM
Leave a comment: