CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 1999
    Posts
    20

    GlobalAllocated memory pointer changing??

    Hi gurus,

    In win 32 bit, when i allocate memory using GLobalAlloc with moveable flag is set.
    Does the pointer return by GlobalLock stay the same each time the GlobalLock is called, or will it change when the memory has been moved?

    Thanks



  2. #2
    Guest

    Re: GlobalAllocated memory pointer changing??

    Plan on it changing...because the moment you assume it doesnt, it will! Thinking out loud here (i.e., I didn't bother to look it up) I'd be willing to bet that if the Heap Manager ever compacts the heap--or moves your block--the address returned by GlobalLock() WILL change. Either way, I wouldn't keep copies of a locked pointer around once I unlocked it...that's just begging for a GPF.

    Cheers!
    Humble Programmer
    ,,,^..^,,,


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured