Re: ESQL/C dynamic SQL and BLOBS
Posted in 1995
The parameters to GlobalAlloc are probably GPTR which results in the allocation of a global segment which is fixed in memory. To free this memory all you need to do is cast the global pointer to a handle, example GlobalFree( (HGLOBAL) loc.lc_buffer ); When Informix ported ESQL/C to windows, one of their biggest problems was handling memory that moves. A windows memory handle is a way of identifying memory objects that move. By locking down the memory ( stopping it from moving ), windows returns you a pointer to the memory. Since the GlobalAllocs in ESQL/C allocate fixed segments, you do not need to lock down the memory to get the windows memory pointer. Windows treats the handle of a fixed memory segment the same as a pointer to that segment.