| |

VerySource

 Forgot password?
 Register
Search
View: 636|Reply: 2

How to find the data length of void * type

[Copy link]

3

Threads

29

Posts

22.00

Credits

Newbie

Rank: 1

Credits
22.00

 China

Post time: 2020-1-3 16:10:01
| Show all posts |Read mode
I want to get data from the clipboard. The data type returned by GetClipboardData () is void *, how do I know its length?

I only deal with bitmaps, HBITMAP hBitmap = (HBITMAP) GetClipboardData (CF_BITMAP); If you can find the length of hBitmap, you can.

Note that it is the length of the hBitmap, not the data structure, don't tell me it is sizeof (HBITMAP)
Reply

Use magic Report

0

Threads

6

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 China

Post time: 2020-1-3 17:24:01
| Show all posts
BITMAP bm;
GetObject (hBitmap, sizeof (BITMAP),&bm);
Reply

Use magic Report

0

Threads

55

Posts

32.00

Credits

Newbie

Rank: 1

Credits
32.00

 China

Post time: 2020-1-3 17:45:01
| Show all posts
HBITMAP is a handle and should be 4 bytes.
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list