Error: explicit type cast cannot convert 'void* to 'int*'

This is a discussion on Error: explicit type cast cannot convert 'void* to 'int*' within the C++ Programming forums, part of the General Programming Boards category; I'm a newbie, so please bear with:
Here's my problem and the line I get an error on:
int *buf ...

Why are you using GlobalAlloc with a GPTR? This has none of the benefits of HANDLE based memory allocation and it has all of the problems of being non-standard. A simple "new" would get you the same results if I'm not mistaken.