how to make a cdc from a hdc ?

I have a HDC, is it possible to make a CDC from it?

thanks,
  bn


0
bn
1/17/2005 12:48:06 PM
vc.mfc 33608 articles. 0 followers. Follow

4 Replies
489 Views

Similar Articles

[PageSpeed] 56

You can do this:

CDC cDC;
cDC.Attach(hdc);

tankc

"bn" <b@b.com> wrote in message
news:%23tSzyNJ$EHA.3372@TK2MSFTNGP10.phx.gbl...
> I have a HDC, is it possible to make a CDC from it?
>
> thanks,
>   bn
>
>


0
kctan73 (2)
1/17/2005 1:18:47 PM
tthere aretwo ways        
CDC      dc;
dc.Attach(hdc);
//do ur stuff
dc.Detach();

or
CDC  dc=CDC::FromHandle(hdc);
//no need to detach.

"bn" wrote:

> I have a HDC, is it possible to make a CDC from it?
> 
> thanks,
>   bn
> 
> 
> 
0
Baachi (1)
1/17/2005 3:55:03 PM
The second one should be CDC * dc = CDC::FromHandle(hdc); since it returns a CDC *.

Note that the Detach() is critical if you want to leave the DC alive, and would constitute
"best practice". 

Either of these methods would work perfectly well.
					joe

On Mon, 17 Jan 2005 07:55:03 -0800, Baachi <Baachi@discussions.microsoft.com> wrote:

>tthere aretwo ways        
>CDC      dc;
>dc.Attach(hdc);
>//do ur stuff
>dc.Detach();
>
>or
>CDC  dc=CDC::FromHandle(hdc);
>//no need to detach.
>
>"bn" wrote:
>
>> I have a HDC, is it possible to make a CDC from it?
>> 
>> thanks,
>>   bn
>> 
>> 
>> 

Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15979)
1/17/2005 7:40:18 PM
thanks for your reply,

Indeed I had tryed these ways, but it seems there is a bug in working with
these functions with metafiles. I use CreateEngMetaFile To get a meta file
DC handle. I need to get a CDC * from this , so I can use my existing codes,
but it seems the above two ways does not work for Meta dcs.

thanks,
   bn

"Joseph M. Newcomer" <newcomer@flounder.com> wrote in message
news:j25ou0lapoe5s5oamt7uhbvm2kcjg0ob4k@4ax.com...
> The second one should be CDC * dc = CDC::FromHandle(hdc); since it returns
a CDC *.
>
> Note that the Detach() is critical if you want to leave the DC alive, and
would constitute
> "best practice".
>
> Either of these methods would work perfectly well.
> joe
>
> On Mon, 17 Jan 2005 07:55:03 -0800, Baachi
<Baachi@discussions.microsoft.com> wrote:
>
> >tthere aretwo ways
> >CDC      dc;
> >dc.Attach(hdc);
> >//do ur stuff
> >dc.Detach();
> >
> >or
> >CDC  dc=CDC::FromHandle(hdc);
> >//no need to detach.
> >
> >"bn" wrote:
> >
> >> I have a HDC, is it possible to make a CDC from it?
> >>
> >> thanks,
> >>   bn
> >>
> >>
> >>
>
> Joseph M. Newcomer [MVP]
> email: newcomer@flounder.com
> Web: http://www.flounder.com
> MVP Tips: http://www.flounder.com/mvp_tips.htm


0
bn
1/18/2005 6:39:42 AM
Reply:

Similar Artilces:

Make Default
Version: 2008 Operating System: Mac OS X 10.5 (Leopard) Processor: Intel Email Client: Exchange Hi I have a script to open entourage to configure a account, although the first time round for every user the script stops due to the message in Entourage asking would you like to make entourage you default browser. <br> Anyone have a script to set this to default or any way of setting this so it never ask's ? <br><br>thanks This is a multi-part message in MIME format. ----------------709806166701805979 Content-Type: text/plain; charset=iso-8859-1; format=flowed C...

Making a Pivot chart from 3 differnt sets of data / worksheets.
Hi, I have 2 workshsheets of data with a list of delivery dates of about 10 different products over the last 3 years, (i cant combine these to just 1 worksheet for other separate reasons) and a 3rd worksheet with a column of the same products and dates that some of these products became faulty and were sent back to me . On a 4th worksheet, I am trying to do a graph that looks at the 3 worksheets and plots pivot table of dates and amount of each product deliveries & returned to me. So as i select ,say, product A from that pivot list, it produces a graph for these 3 variables (dat...

making a transfer show up in the budget
Hi all. I am running MS money 2006. How do I make a transfer show up in my budget? I have several liabilities and credit cards, and I would like to make a budget with the monthly amount owed to each creditor showing up in my budget. The MS Money 2006 standard program does not allow me, as far as I can tell, to make a monthly transfer to a credit card or liability show up in my budget, unless I make it a category. Any help with this is much appreciated. thanks See http://umpmfaq.info/faqdb.php?q=124 for the short answer. You may be more interested in "cash flow" than &qu...

making tickets
what is the best way to make numbered tickets using Publisher 2002? Hi lc (rconnell@numail.org), in the Microsoft Office Publisher newsgroup you posted: || what is the best way to make numbered tickets using || Publisher 2002? Check out the following link: http://www.mvps.org/publisher/numbering1.html -- Brian Kvalheim Microsoft Office Publisher MVP Official Publisher MVP Site: http://www.kvalheim.org This posting is provided "AS IS" with no warranties, and confers no rights. >-----Original Message----- >what is the best way to make numbered tickets using >Publi...

How make a favorite for all users in Ex2007/OWA/Documents area?
I am playing around with OWA in 2007 and exploring the "documents" feature of OWA that allows users to view Windows file shares by UNC. There is the individual "add to favories" option, but does anyone know of a way to administratively specify a favorite for all users? The alternative seems to be logon as each user to setup the same favorite--surely that is not the only way? Thanks for any help! Evan ...

AN OPPORTUNITY TO MAKE $$$
THIS REALLY WORKS IF YOU FOLLOW THROUGH!!! MAKE MONEY!!! MAKE MONEY!!! MAKE THOUSANDS OF "$$$" !!! I found this "NETWORKING PROJECT" on a bulletin board and decided to try it: All I say is, it "WORKS". All it takes is a small INVESTMENT of your "TIME" AND "less than $10.00"! INTERESTED??? E-mail: "spotty3443@yahoo.com" for DETAILS. ...

how do you make all incoming emails bold?
"Beth" <Beth@discussions.microsoft.com> wrote in message news:CD76AE42-9EC9-44C8-90FB-3A0566671AC4@microsoft.com... > I could've sworn there was a message here, but when I looked the body was completely blank. Oh well, guess the poster really didn't want to ask a question. how do you make all incoming emails bold? "Vanguard (NPI)" wrote: > "Beth" <Beth@discussions.microsoft.com> wrote in message > news:CD76AE42-9EC9-44C8-90FB-3A0566671AC4@microsoft.com... > > > > > I could've sworn there was a messag...

How do I make the X-Axis increase in scale with the quantity?
For example: If I have the values 1.5, 3.5, 8.7, 9.9 in the x values for a line graph, is there anyway to make them spaced apart so that they are in scale with eachother... Like so the distance between 3.5 and 8.7 is larger than, the distance between 1.5 and 3.5? Create a XY Scatter chart. It, and a bubble chart, are the only 2 that allow for cardinals values on the x axis. -- Regards, Tushar Mehta www.tushar-mehta.com Excel, PowerPoint, and VBA add-ins, tutorials Custom MS Office productivity solutions In article <F2D3DC58-86D3-4D21-9D57-F704A78941FB@microsoft.com>, =?Utf- 8...

How to make VLOOKUP work for this
I have a "master" spreadsheet where column A is a time column and every row represents a second (in plain text format) such as 00:00, 00:01, 00:02.... 00:59:, 01:00, 01:01, 01:02,... and continues on for 24 minutes... 23:59, 24:00. (1442 rows). Off to the side (I'm thinking of putting it on another sheet though) I have a small table where I'll enter the time and corresponding data I need populated in Column B, and will look something like the following example; My question(s) are, is the VLOOKUP function the best way to populate column B with the values? It's ...

Make Personal Calendar Read Only
I would like to make a users personal calendar read-only to the user. The individuals calendar is delegated to about 5 others and they need full access, but I do not want the end-user to have full access but read only. How do I go about changing these permissions? Thanks, Brian I don't believe that is even possible through the standard means, it is a little bizarre. You may be able to do it through a tool like ADSIEdit. Nue "HoosierDaddy" <bjorgenson@charter.net> wrote in message news:1139250053.396235.106790@o13g2000cwo.googlegroups.com... >I would like to make a...

How do I make more than 12 entries in excel balance sheet templat.
The excel balance sheet template is exactly what I need. How do I get it to expand to an infinite number of entries?? office xp ...

Is it Possible to make a table from a query without a Make Table Q
Is it possible to make a table with a query as the record source, without using a Make Table Query. The reason that I as is that I have a rather large database that I use to create tables for each day of the month based on activity recieved from a larger database. I use one Pass-Through query as the source for 31 Make Table queries. The reason I have done this is because I need to segregate the activity by date so that I can produce daily averages over the entire month. The reason that I have had to break each one per day is the Pass Through query is huge (returning 7,000,000 + rec...

Making a bmp transparent
Using Publisher 2000 Windows 98SE Is it possible to make a graphic file transparent? I'm attempting to create a motivational cartoon and would like to have a couple of scenes in the background. To do this I think I need to make an image file transparent. Can it be done? I have Paint Shop Pro and MS Paint. I have the challenge in the file, "Problem.zip" which can be downloaded at: http://www.tinyurl.com/wifs On the "Odds, Ends & Funny Things page. Click on the Snowman. 'Appreciate the help. -- Don -------- Vancouver, USA - One of the great cities in one of...

How to make Frames??
how to make frames in microsoft publisher??? You use the Tool called TEXT FRAME Pretty easy I would have thought - obviously a challenge for some. -- i try to find in tool section.. but there is no button called TEXT FRAME? can u tell me the steps! PLZ!! Thankx.. and one more question.. i would link some sites... but i want that link(site) to be pop up in new window.? how to do it??? i've been trying to find it.. but then it always pop up in same window.. and could u tell me the steps?? plz. Thanzk Trust me, there is most definitely a button called Text Frame. Look in the HEL...

How to make this report simple? Thanks
How to combine all items to be read better? I mean just now I have 3 products however to each of theme are the same items / Rqst, EG, SP, EG-SP/ and I would like to meka it simplier. July2006 August2005 Group1 Group2 Group3 Group1 Group2 product1 Rqst 4301 0 250 120 75 EG 3560 0 150 80 100 SP 3200 0 120 40 50 EG-SP 360 0 65 30 200 product2 Rqst 100 150 EG SP EG-SP product3 Rqst EG SP EG-SP Thanks a lot for any kind of info. Juraj / mer68@zmail.sk ...

How to make a stacked bar chart using time?
Hi, I have the following data to plot on a stacked bar chart, and displayed as time. Dr X Dr Y Dr Z 02:03 03:00 01:00 00:20 02:00 00:30 00:40 01:00 00:30 02:45 01:00 00:15 02:10 08:13 07:00 02:00 This is time in hours and minutes. I need the result to look like this... Dr.X bar [02:03][00:20][00:40][02:45][00:15][02:10] Dr.Y bar [03:00][02:00][01:00][01:00] Dr.Z bar [01:00][00:30][00:30] where [02:03] represents a colour to represent 2 hrs & 3 mins etc. If I just select the Dr. X data I can get a stacked chart, but as soon as I add either Dr. Y or Dr. Z data the whole chart ...

making lines around info so it looks like a table when printed or viewed
Version: 2008 Operating System: Mac OS X 10.4 (Tiger) How do I put horizontal and vertical lines around all the cells so it looks like a table? Display the Toolbox by hitting the Toolbox button. Activate the Formatting Palette (upper left button) then chose Borders and Shading. Make sure you select the cels you want to format.... <br><br>make your choice in de button that has &quot;type:&quot; in front of it. Done Thank you I have been successfully making borders in all my excel worksheets but since the latest update, the palette in excel no longer works. At firs...

How do I make each row add up seperatly? Please make it easy...
I have never set up anything on excel before. My job has always had it ready for me. I want to do this to help me figure out how much I will need for my baking ingredients for the holidays. I thought that I could put a row for sugar, and then for everything I am making with sugar type in 3/4 cup and 1 1/2 cups then at the end of all the sugar items have it add how much I will need. Can anyone tell me step by step how to set this up?? Please make it easy I am not computer smart at all. I'm willing to take this project on! Why don't you email what you have to ng@officear...

making numbered tickets
how can I make numbered tickets for my group without having to pay a printer? There is a template for numbered tickets here (raffle ticket) http://www.publishermvps.com/General/Templates/tabid/38/Default.aspx Consecutive numbering tutorial http://www.publishermvps.com/Default.aspx?tabid=95 -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "carmelitahaynes@hotmail.com" <carmelitahaynes@hotmail.com@discussions.microsoft.com> wrote in message news:6068BB43-C2AB-4046-8467-20610ECE66E5@microsoft.com... > how can I make num...

Vlookup or something more? Trying to make the book intuitive...
Hi there, I hope you can help. I’m trying to make my life much easier by making a currently unwieldy spreadsheet into one that’s a lot more intuitive. Currently I have to enter data twice into the same spreadsheet but I hope to be able to enter it once and have the other sheets automatically update. First, the explanation… This is a spreadsheet that tracks the holidays of a department of 20 people. Currently it fulfils a few functions. First, it tracks each individual on their own worksheet which goes into details (date began/ended, etc). Second, it tracks them all together on an...

Make a window active
Hey all I'm trying to write a script that will make Outlook the active window, whether its minimized or not. It will then send Alt+F4 to close it. I have no idea how to make Outlook the active window. Any ideas? On Jan 26, 11:41=A0am, Matt Longo <justice8...@gmail.com> wrote: > Hey all > > I'm trying to write a script that will make Outlook the active window, > whether its minimized or not. It will then send Alt+F4 to close it. I > have no idea how to make Outlook the active window. Any ideas? I wouldn't do it that way. I'd access the provid...

how to make controls move after parent resize?
Hi all, I've created a dialog based app, and I have put some controls in it that I want to move or resize when I resize the dialog. In the old days, on certain non-Windows machines this was done by specifying that a control was attached to one or more edges of the parent, and the GUI took care of changing the controls' positions and sizes. But how is this done under Windows? Is there an easy answer? Thanks in advance -V One solution is to handle WM_SIZE in your dialog. Then move/resize the controls in OnSize. Regards Niraj "Varf" <Varf@hoopomail.com> wrote in message ...

How do I make "Search In All Mail Folders" actually search all of them?
How do I make "Search In All Mail Folders" actually search all of them? When I select "All Mail Folders" from dropdown, it only inserts Drafts;Inbox;Outbox;Sent Items into the "Search In" field, Is there any way to make that dropdown actually list all mail folders or do I have to select them all by hand each time? Any help or pointers to help are appreciated. Thanks, Ken Outlook version? What search engine are you using? WDS? GDS? -- Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. After furious head sc...

How can I make the graph omit blank cells in the data set?
Hi, I've been workin' on the problem below that I've written a few days ago but got no answers. It's easy to select spesific cells to another column for ex: cells belong to type A then I draw the graph but a new problem occured, there are empth cells and mygraph counts them next question: how can I omit the blank cells from my data set while graphing? Thx a lot :) Emre UNAL http://www.geocities.com/dusemre Main Problem: Hi, I have a mixed data set as exampled below, Type Value A 14 B 0.156 C 1.65 A 18 D 4...

How do you make a....
Dropdown Menu, but then a program that imputs information when a certai one from the dropdown menu is selected. Making an order form that auto puts in information depending on whic vender the user selects. So, for instance. If the user selects "Wal-mart" ( I know bad exampl lol), in the 5 empty cells below it fills out the address that specify. Thanks in advance : -- Akusuzak ----------------------------------------------------------------------- Akusuzaku's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=2563 View this thread: http://www.excelforu...