Solved

HDC converting

Posted on 1997-07-20
1
551 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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

zlib is a free compression library (a DLL) on which the popular gzip utility is built.  In this article, we'll see how to use the zlib functions to compress and decompress data in memory; that is, without needing to use a temporary file.  We'll be c…
For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
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…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

746 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

13 Experts available now in Live!

Get 1:1 Help Now