Solved

Converting a handle to a structure

Posted on 1998-06-12
3
251 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying 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

Suggested Solutions

Title # Comments Views Activity
C++ get user from AD  (VS6) 7 86
How to copy an image file into clipboard C/C++? 1 199
Socket Programming (Unix) 8 142
thread-safe code in c++ 2 116
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
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 tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

831 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