Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

HDC converting

Posted on 1997-07-20
1
Medium Priority
?
577 Views
Last Modified: 2013-12-03
Hello....I want to convert HDC -> memory block (memory pointer)
because my program used RPC function on win95.
I need to transfer DC. but I can't use that User-marshalling on win95.
therefore i need to convert HDC -> memory block.
I used this method.
HDC -> Metafile -> memory pointer

-------------------------------------------------

srcDC = CreateEnhMetaFile(hDC, NULL, NULL, NULL);
BitBlt(srcDC, 0, 0, rect->right, rect->bottom, hDC, 0, 0, SRCCOPY);
hMetaFile = CloseEnhMetaFile(srcDC);
nSize = GetEnhMetaFileBits(hMetaFile, 0, NULL);
lpMem = (LPBYTE) GlobalAlloc(GPTR, nSize);
GetEnhMetaFileBits(hMetaFile, nSize, lpMem);

---------------------------------------------------

but very slow!!!
how can i use better method than metafile !!!
thank you!!!

0
Comment
Question by:pcs071997
1 Comment
 
LVL 3

Accepted Solution

by:
jaba earned 200 total points
ID: 1401403
You can create bitmap , draw all you own data into it , save it in memory file , when , use you RPC call . Other module will get this bitmap file, load bitmap and draw into it. When you can put bitmap on reall window DC. This methond is nice.
0

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

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

What my article will show is if you ever had to do processing to a listbox without being able to just select all the items in it. My software Visual Studio 2008 crystal report v11 My issue was I wanted to add crystal report to a form and show…
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

772 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