Whats the difference between these two guys? I see some of your code use "GlobalAlloc" is there any advantage to use GlobalAlloc over HeapAlloc because all the code I'm writing uses HeapAlloc.
Quoting from msdn
Platform SDK: Memory Management
GlobalAlloc
The GlobalAlloc function allocates the specified number of bytes from the heap. Windows memory management does not provide a separate local heap and global heap.
Note The global functions are slower than other memory management functions and do not provide as many features. Therefore, new applications should use the heap functions. However, the global functions are still used with DDE, the clipboard functions, and OLE data objects.
Now if I remember correctly GlobalAlloc was of use when windows 3.1 was around (the system was 16 bit).
So probably "not sure" GlobalAlloc calls HeapAlloc, so you should opt to use HeapAlloc over GlobalAlloc.
Platform SDK: Memory Management
GlobalAlloc
The GlobalAlloc function allocates the specified number of bytes from the heap. Windows memory management does not provide a separate local heap and global heap.
Note The global functions are slower than other memory management functions and do not provide as many features. Therefore, new applications should use the heap functions. However, the global functions are still used with DDE, the clipboard functions, and OLE data objects.
Now if I remember correctly GlobalAlloc was of use when windows 3.1 was around (the system was 16 bit).
So probably "not sure" GlobalAlloc calls HeapAlloc, so you should opt to use HeapAlloc over GlobalAlloc.