Solved

Converting a handle to a structure

Posted on 1998-06-12
3
230 Views
Last Modified: 2010-04-10
I have a handle returned from the clipboard which points to a metafile. I want to convert it to the metafile structure so that I can save it to the disk.

How can I do it.

Thanks in advance

nikhilh
0
Comment
Question by:nikhilh
3 Comments
 
LVL 1

Expert Comment

by:Andy_Keys
ID: 1165727
I assume the handle from the cipboard is a handle to a global memoy block in which case you should be able to do somthing like
GlobalLock this returns a ptr to the data so you can cast this to a ptr to the metafile struct.
0
 
LVL 2

Author Comment

by:nikhilh
ID: 1165728
It does not work
0
 

Accepted Solution

by:
unmeshv earned 50 total points
ID: 1165729
If it is an handle to metafile, i.e. HMETAFILE (if it is HENHMETAFILE for enhanced meta files) try using CopyMetaFile or CopyEnhMetaFile functions.

It is something like

CopyEnhMetaFIle(hMetaFileHandle, *pFile);
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

912 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

16 Experts available now in Live!

Get 1:1 Help Now