473,407 Members | 2,676 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

How to get a LOGFONT from an HFONT

I am using some COM interface to create some HFONT.
Trouble is, the font created with this COM interface should be release with
this COM intrface.
And I don't see how I could make it work nicely with my ManagedC++ wrapper.

The solution I though of is:
when the COM interface create this reference I "clone" it and release it
immediately, and I could hgo on my business with this "clone"

So...
is there anyway to clone an HFONT?
Nov 17 '05 #1
2 2525
Found out!
SelectObject() => GetObject()

--
There are 10 kinds of people in this world. Those who understand binary and
those who don't.
"Lloyd Dupont" <ld@NewsAccount.galador.net> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
I am using some COM interface to create some HFONT.
Trouble is, the font created with this COM interface should be release
with this COM intrface.
And I don't see how I could make it work nicely with my ManagedC++
wrapper.

The solution I though of is:
when the COM interface create this reference I "clone" it and release it
immediately, and I could hgo on my business with this "clone"

So...
is there anyway to clone an HFONT?

Nov 17 '05 #2
"Lloyd Dupont" <ld@NewsAccount.galador.net> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
So...
is there anyway to clone an HFONT?


Check the docs for GetObject() if your question is as in the subject line.

Regards,
Will
Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Justin Van Patten | last post by:
Hello, I am having trouble converting a LOGFONT structure to a System.Drawing.Font object. I'm calling SystemParametersInfo to get the LOGFONT lfntSMCaptionFont from a NONCLIENTMETRICS...
14
by: Howard | last post by:
Hi, I recently had a problem where I decided to store objects in a vector. (Previously, I had always stored pointers in vectors). Well, naturally, when storing an object in a vector, using...
1
by: Herve Bocuse | last post by:
Hi, In C++ I was used to this code to get a GUI system font : LOGFONT lf; ::SystemParametersInfo(SPI_GETICONTITLELOGFONT,sizeof(LOGFONT),&lf,0); HFONT hFont = ::CreateFontIndirect(&lf); ...
5
by: Lloyd Dupont | last post by:
I'am using C# and I would like to use the INLangFontLink interface: http://msdn.microsoft.com/library/default.asp?url=/workshop/misc/mlang/reference/ifaces/imlangfontlink/imlangfontlink.asp I...
3
by: spielmann | last post by:
Hello I want to change the scrollbar size of windows, How can I do that with vb.net I have find this in VB6 but how can we convert simply this code. thx
3
by: Scott | last post by:
Consider the follow code snippet. Why doesn't it work? // Initialize a CFont object with the characteristics given // in a LOGFONT structure. LOGFONT lf; memset(&lf, 0, sizeof(LOGFONT));...
1
by: chris.dannemiller | last post by:
I have the following code public static IntPtr CreateFont ( Font fnt ) { LOGFONT logFont = new LOGFONT(); logFont.lfFaceName = fnt.Name; logFont.lfHeight = -Win32API.MulDiv((int)fnt.Size,...
2
by: Frank | last post by:
I do the following to pick a font. Each letter this creates is displayed in a small solid colored rectangle. Instead, I'd like the background image to show around the letters Is there an...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.