Solved

Converting a handle to a structure

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

758 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

17 Experts available now in Live!

Get 1:1 Help Now