Ok, i will do this thing, also i have some question about:

i have a structure, that old a pointer to a string.. or ASCIZ, that is not the problem, this will be a linked list ( i think can be impemented to witha nd array), but i for practice use linked list, my question is Local/Global-Alloc return a handle and then you lock that, if you pass GMEM_FIXED, it return a pointer instead of the handle, like i understand this is only if you will be using a space in memory that maybe not be resized or it will be, like the flag say FIXED


my question is.. if i not use GMEM_FIXED, then i need save all the handles in my structure or i only use the handle for the Global/Local-Lock, or only i need they only drop in the space.. i supose this is a bad way of programin...


ok. some like:

struc some
.hola resd 1
.lpstr resd 1
.next resd 1
endstruc

to this structure i need add a member that save the value of the handle???, like this:

struc some
.hola resd 1
.lpstr resd 1
.handleAlloc resd1 ;i need this?
.next resd 1
endstruc


or in my code i can make only some like (losing the handle??):

WMSOMECOMMAND:
call or invoke.. (only in my case)
call GlobalAlloc, GMEM_MOVABLE, someNumeber
call GlobalLock, eax ;here i only lost the handle
mov dword, eax


I supose for the moment i will use GMEM_FIXED, but i am confused, if i some day use GMEM_MOVABLE, or other that return a handle. Then I need save all the handles?? in all my structs??

I think that was little confuse, but i think you get the idea ;)

Nice day.
Posted on 2003-06-04 12:20:16 by rea
You won't lose the handle. It can always be used to reference the memory block until you free it.

GMEM_MOVEABLE is just so that Windows can better manage the heap. Unless your program will be fragmenting the heap often, doing a lot of different-sized allocations and deallocations, don't worry about it.
Posted on 2003-06-04 14:25:39 by iblis