Click here to Skip to main content
15,923,087 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to convert correctly? Pin
Stephen Hewitt26-Apr-06 17:29
Stephen Hewitt26-Apr-06 17:29 
GeneralRe: How to convert correctly? Pin
Nibu babu thomas26-Apr-06 17:41
Nibu babu thomas26-Apr-06 17:41 
GeneralRe: How to convert correctly? Pin
Stephen Hewitt26-Apr-06 17:48
Stephen Hewitt26-Apr-06 17:48 
GeneralRe: How to convert correctly? Pin
Nibu babu thomas26-Apr-06 17:57
Nibu babu thomas26-Apr-06 17:57 
GeneralRe: How to convert correctly? Pin
Ryan Binns26-Apr-06 18:09
Ryan Binns26-Apr-06 18:09 
AnswerRe: How to convert correctly? Pin
Ryan Binns26-Apr-06 18:23
Ryan Binns26-Apr-06 18:23 
AnswerA little different !!! Pin
M_Nuaimi27-Apr-06 14:30
M_Nuaimi27-Apr-06 14:30 
GeneralRe: A little different !!! Pin
Ryan Binns27-Apr-06 19:25
Ryan Binns27-Apr-06 19:25 
QuestionAbout MDI step debug in vs2003 Pin
zhoucheng26-Apr-06 15:04
zhoucheng26-Apr-06 15:04 
AnswerRe: About MDI step debug in vs2003 Pin
Ryan Binns26-Apr-06 16:16
Ryan Binns26-Apr-06 16:16 
GeneralRe: About MDI step debug in vs2003 Pin
zhoucheng26-Apr-06 20:20
zhoucheng26-Apr-06 20:20 
QuestionNeed a class to display normal text and hyperlinks Pin
Defenestration26-Apr-06 13:30
Defenestration26-Apr-06 13:30 
AnswerRe: Need a class to display normal text and hyperlinks Pin
Nibu babu thomas26-Apr-06 17:16
Nibu babu thomas26-Apr-06 17:16 
QuestionHaving some problems, and it may be a pointer issure Pin
kuroiryu26-Apr-06 13:04
kuroiryu26-Apr-06 13:04 
AnswerRe: Having some problems, and it may be a pointer issure Pin
ankita patel26-Apr-06 13:39
ankita patel26-Apr-06 13:39 
GeneralRe: Having some problems, and it may be a pointer issure Pin
kuroiryu26-Apr-06 14:16
kuroiryu26-Apr-06 14:16 
GeneralRe: Having some problems, and it may be a pointer issure Pin
ankita patel26-Apr-06 14:20
ankita patel26-Apr-06 14:20 
AnswerRe: Having some problems, and it may be a pointer issure Pin
Nibu babu thomas26-Apr-06 18:46
Nibu babu thomas26-Apr-06 18:46 
GeneralRe: Having some problems, and it may be a pointer issure Pin
kuroiryu27-Apr-06 5:20
kuroiryu27-Apr-06 5:20 
QuestionHiding cursor Pin
Kleser26-Apr-06 12:13
Kleser26-Apr-06 12:13 
AnswerRe: Hiding cursor Pin
Michael Dunn26-Apr-06 13:13
sitebuilderMichael Dunn26-Apr-06 13:13 
AnswerRe: Hiding cursor Pin
Naveen26-Apr-06 17:16
Naveen26-Apr-06 17:16 
QuestionMeasure width of a single character Pin
richiebaby26-Apr-06 12:08
richiebaby26-Apr-06 12:08 
Hi
Could I please get some help measuring the width of a character.

I am writing a simple app that draws text to the form and is it is possible to set the font differently for each char. It is within .NET 2003 and I am currently doing this to get the width of a character (each string is one character):

textSize = g->MeasureString(tempString, font);

This works but I have to optimise the code as much as possible and I have been informed by my C++ lecturer to 'hand write' another way to measure the width of a string/char.

Could someone please explain how this could be done by means of an example? Initial research has led me to GetCharWidth32 and GetTextExtent, but I'm buggered if I know how they work! For instance, GetCharWidth32 has 'hdc' (a handle to DC) -- That's all that MSDN tells you and I have absolutely no idea what it is!!!

Could someone please supply an example where you know what the char or string (with 1 character) is and simply get a float or int that is the width?

Thanks
AnswerRe: Measure width of a single character Pin
Trollslayer26-Apr-06 12:34
mentorTrollslayer26-Apr-06 12:34 
GeneralRe: Measure width of a single character Pin
richiebaby26-Apr-06 23:52
richiebaby26-Apr-06 23:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.