Link to home
Start Free TrialLog in
Avatar of jlugo
jlugo

asked on

GlobalLock and GetClipboardData

I'm using VC++ 6.0.  I'm calling the SDK function GetClipboardData in my program.  It returns a HANDLE.  I was calling GlobalLock to get a poiner to the data.  However, GlobalLock "is provided only for compatibility with 16-bit versions of Windows".

So, is there a better way of getting the data pointer without using the 16 bit SDK ?
ASKER CERTIFIED SOLUTION
Avatar of nietod
nietod

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of nietod
nietod

What the documentation is trying to say is that GlobalAlloc() and the related function are no longer used for allocating memory for use by the program.  A C++ program should use new to allocate memory for its use or in some cases can use the win32 heap functions to allocate memory.  However, the global allocation functions are still needed in cases like the clipboard where memory muyst be allocated by your program, but then is "managed" (used and then deleted) by the operating system.