?
Solved

about clipboard

Posted on 1998-10-16
1
Medium Priority
?
328 Views
Last Modified: 2013-11-20
Now i use vc++5 and would like to use clipboard
in my application .I would like to transfer my data
 to clipboard from my Class .My class stored ( picture data, text, etc ) how i transfer data from my class to clipboard?
I try to transfer picture data to clipboard
it can work. but i don't how to transfer data in my class to clipboard.
please advise me to do it
thank you
0
Comment
Question by:eakkung
[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
1 Comment
 
LVL 8

Accepted Solution

by:
Answers2000 earned 200 total points
ID: 1323433
To transfer text

         The sequence should be

         1. GlobalAlloc - to give HGLOBAl - do NOT forget extra byte for terminating NUL char (allocate length of string + 1)
         2. GlobalLock to get pointer
         3. Copy string to the pointer, e.g. using lstrcpy
         4. GlobalUnlock
         5. OpenClipboard
         6. EmptyClipboard
         7. SetClipboardData CF_TEXT and the HGLOBAL you got in #1
         8. CloseClipboard

         The most likely causes are forgetting the terminal NUL on the string (either not copying it or not allocating the extra byte), or an incorrect sequence of the above

To transfer a DDB (device dependant bitmap) bitmap (HBITMAP handle)

         1. OpenClipboard
         2. EmptyClipboard
         3. SetClipboardData CF_BITMAP and the HBITMAP
         4. CloseClipboard

To transfer DIB (device independant bitmap handle) (HANDLE handle)

         1. OpenClipboard
         2. EmptyClipboard
         3. SetClipboardData CF_DIB and the HANDLE
         4. CloseClipboard



0

Featured Post

Get MySQL database support online, now!

At Percona’s web store you can order your MySQL database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card.

Question has a verified solution.

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

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

801 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