Solved

HDC converting

Posted on 1997-07-20
1
575 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

This article shows how to make a Windows 7 gadget that extends its U/I with a flyout panel -- a window that pops out next to the gadget.  The example gadget shows several additional techniques:  How to automatically resize a gadget or flyout panel t…
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 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…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

636 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