TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: RICHARD HIRNER
from: ADAM MAJER
date: 1998-03-04 15:02:00
subject: BC++ 3.1 Memory Allocatio

RH>If I allocate global memory using the Windows 3.1-API
RH>function HANDLE GlobalAlloc(WORD, DWORD), what do I do with
RH>the returned handle?
You have to lock the memory into place with the GlobalLock function.
Later you'll have to unlock it with the GlobalUnlock. The handle
indicates allocated memory but it can be moved around while locked
memory can't - I think it has something to do with descriptors (no
segments in protected mode). Anyways, GlobalLock returns the pointer to
our memory location.
LPSTR GlobalLock(HANDLE);
PS. Define STRICT before you compile your program. This will enable
tighter syntax checking. :)
Hope that helps!
 * SLMR 2.1a * I'm in shape ... round's a shape isn't it?
--- FMail 0.92
---------------
* Origin: The Programmer's Oasis on FIDONET! (1:348/203)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.