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
Solved

GlobalLock and GetClipboardData

Posted on 1998-10-15
2
810 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
  • 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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
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 pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

840 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