Solved

GlobalLock and GetClipboardData

Posted on 1998-10-15
2
814 Views
Last Modified: 2011-09-20
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 ?
0
Comment
Question by:jlugo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 22

Accepted Solution

by:
nietod earned 100 total points
ID: 1175240
The docs aren't 100% correct.  This is one of the few cases where it is needed.
0
 
LVL 22

Expert Comment

by:nietod
ID: 1175241
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.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Getting IP address 8 104
designing in object programming 12 110
what type of pointer is this pointer? 3 24
Need some help with design 17 23
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

697 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question