Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

GlobalLock and GetClipboardData

Posted on 1998-10-15
2
Medium Priority
?
839 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 300 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

610 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