Congratulations to AcaCandy on her 100,000th post!
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
acer black screen blue screen boot bsod computer connection crash css dell display drive driver drivers email error ethernet excel firefox firefox 3 game hard drive internet internet explorer itunes laptop linux malware monitor network networking nvidia outlook outlook 2003 outlook 2007 outlook express partition problem router slow software sound trojan usb video virus vista windows windows xp wireless
Software Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Software & Hardware > Software Development >
MFC - CFontDialog


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

Closed Thread
 
Thread Tools
juryu's Avatar
Junior Member with 18 posts.
 
Join Date: Feb 2003
Location: Rio
18-Sep-2003, 08:51 PM #1
MFC - CFontDialog
Hi people,

I am having trouble initializing my CFontDialog with the font I want. Obviously

CFontDialog * fd = new CFontDialog;
fd->DoModal():

shows the font dialog with no font selected.
Now, I have a CFont * called ss_font, so I try this

LOGFONT lf;
ss_font->GetLogFont(&lf);
CFontDialog * fd = new CFontDialog(&lf);
fd->DoModal():

And now it shows different values, but not the ones on my CFont!! For example, font size is something ridiculously big like 30000...

So I thought maybe I need CHARFORMAT. I try creating a CHARFORMAT and putting all the values from my LOGFONT in it, and then calling

CFontDialog * fd = new CFontDialog(&cfm);
fd->DoModal():

But then the compiler gives an error!!

error C2664: '__thiscall CFontDialog::CFontDialog(struct tagLOGFONTA *,unsigned long,class CDC *,class CWnd *)' : cannot convert parameter 1 from 'struct _charformat *' to 'struct tagLOGFO
NTA *'

Duh, it obviously wanted a LOGFONT and not a CHARFORMAT. But then why didn't it show the correct values when I gave it the LOGFONT?

Can anybody give me some help? I've already posted this in other forums and got no reply.
Closed Thread

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who help people like you solve computer problems. See our Welcome Guide to get started.



Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 04:07 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.