Solved

about clipboard

Posted on 1998-10-16
1
306 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
1 Comment
 
LVL 8

Accepted Solution

by:
Answers2000 earned 100 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Include multiple hostnames in this command? 3 55
Host to IP 7 78
deburging in oracle form 12 98
matchUp  challenge 6 60
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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 I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

813 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now