473,796 Members | 2,509 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

IFont <-> System::Drawing ::Font

(Posted here because nobody wants to answer me in framework.inter op, and I
_am_ using VC++!)

IFont to System::Drawing ::Font is easy enough: get the hFont property and
then use Font::FromHfont .

But how can I go from a Font to a corresponding IFont?

TIA

Phil Atkin
Nov 17 '05 #1
3 1663
Hi Phil!
IFont to System::Drawing ::Font is easy enough: get the hFont property and
then use Font::FromHfont .

But how can I go from a Font to a corresponding IFont?


See: OleCreateFontIn direct
http://msdn.microsoft.com/library/en...4948f2f72c.asp

--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/
Nov 17 '05 #2
>> But how can I go from a Font to a corresponding IFont?

See: OleCreateFontIn direct
http://msdn.microsoft.com/library/en...4948f2f72c.asp


For an example see here:
http://www.experts-exchange.com/Prog..._20265861.html

--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/
Nov 17 '05 #3
OleCreateFontIn direct: thanks; I was afraid of that...

I haven't seen the example (don't subscribe to Experts Exchange - is it
worth it?) but it seems like hard work to unpick all the properties of an
existing object, pack them into a structure, and then recreate everything.
Still, if that's the only way...

Thanks again,

Phil

"Jochen Kalmbach [MVP]" <no************ ********@holzma .de> wrote in message
news:u5******** ********@tk2msf tngp13.phx.gbl. ..
But how can I go from a Font to a corresponding IFont?
See: OleCreateFontIn direct

http://msdn.microsoft.com/library/en...4948f2f72c.asp
For an example see here:
http://www.experts-exchange.com/Prog..._20265861.html
--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/

Nov 17 '05 #4

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

Similar topics

0
1051
by: 2G | last post by:
Hello everybody, I'm triyng to uninstall a font but I have some problems doing it. If anyone would take a look at it, thx in advance. private void cmdUninstall_Click(object sender, System.EventArgs e){ clsFontFamily f = (clsFontFamily)cboFonts.SelectedItem; string n = f.Path.Substring(f.Path.LastIndexOf("\\")+1); int i = RemoveFontResource(iPath + "\\" + n); SendMessage((System.IntPtr)HWND_BROADCAST, WM_FONTCHANGE, 0, 0);
3
1701
by: Ram | last post by:
I am working with Richtextbox and tom in c#. Everything works fine, but I am unable to get the ITextFont object from the IDocument interface nor do I see functions GetFont and SetFont in ITextRange and ITextSelection. What's wrong? Found that windows2000 has default Richedit 3.0 ( Riched20.dll.)and I am working in 2000 professional.. Thanks and Regards Ram
2
2438
by: Ludis | last post by:
Hi all Im having a problem im my class "utils". Im using linux slackware 8.0 (old? yes: so old). i trying g++ (gnu c++ compiler) 3.1 and glib default of Slack 8.0. I cant migrate this server now, but i need to compile my class in this machine... See my class:
1
1244
by: shashikanta | last post by:
hi friends I want to Display two different types of font in my richtext box e.g:- 1.Description descr....... line1 line2 2.Price
0
7806
by: PracticalApps | last post by:
I looked to find a canned solution to create a Word document in my application and just couldn't find anything that just gets to the point. I would think, and I may be making too strong of an assumption here, that anyone looking for this kind of solution would just want a simple example that they can work from and expand upon. In my case, I just want to output a new Word document. I found that creating a simple wrapper class would make this...
0
3480
by: ishay44 | last post by:
Hello! I try to build (using Visual 2005 and Excel 2007) the example described in the Microsoft Help and Support "How to automate Excel from MFC and Visual C++ 2005 or Visual C++ .NET to fill or obtain data in a range using arrays" (URL: http://support.microsoft.com/kb/308407), and I run into same problem as described in the MSDN Forums "Newbie Q regarding MFC automation client app"...
4
1989
gsgurdeep
by: gsgurdeep | last post by:
I am using rich text box control in my vb.net windows application to format some user define text formatting. I placed 3 buttons for bold, italic, & underline to change text formatting. These buttons perform very well separately. But when want to use more than one option at same text, latest formatting option overwrites previous formatting. Give Me Any Suggestion Please Help Me.
0
9680
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9528
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10456
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10230
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
6788
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5575
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4118
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3731
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2926
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.