Click here to Skip to main content
15,896,557 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
AnswerRe: Measure width of a single character Pin
Blake Miller26-Apr-06 13:03
Blake Miller26-Apr-06 13:03 
QuestionGet current cursor type Pin
khb26-Apr-06 9:21
khb26-Apr-06 9:21 
AnswerRe: Get current cursor type Pin
Ryan Binns26-Apr-06 14:02
Ryan Binns26-Apr-06 14:02 
GeneralRe: Get current cursor type Pin
khb26-Apr-06 21:16
khb26-Apr-06 21:16 
GeneralRe: Get current cursor type Pin
Ryan Binns26-Apr-06 23:50
Ryan Binns26-Apr-06 23:50 
GeneralRe: Get current cursor type Pin
balaji16727-May-14 1:39
balaji16727-May-14 1:39 
QuestionCall Dll Pin
cuongcntt200226-Apr-06 8:01
cuongcntt200226-Apr-06 8:01 
AnswerRe: Call Dll Pin
Nibu babu thomas26-Apr-06 17:19
Nibu babu thomas26-Apr-06 17:19 
QuestionBig int Pin
#hackC++26-Apr-06 7:48
#hackC++26-Apr-06 7:48 
AnswerRe: Big int Pin
Joe Woodbury26-Apr-06 7:54
professionalJoe Woodbury26-Apr-06 7:54 
GeneralRe: Big int Pin
David Crow26-Apr-06 8:02
David Crow26-Apr-06 8:02 
GeneralRe: Big int Pin
Joe Woodbury26-Apr-06 8:18
professionalJoe Woodbury26-Apr-06 8:18 
GeneralRe: Big int Pin
David Crow26-Apr-06 8:25
David Crow26-Apr-06 8:25 
GeneralRe: Big int Pin
#hackC++26-Apr-06 8:04
#hackC++26-Apr-06 8:04 
GeneralRe: Big int Pin
Joe Woodbury26-Apr-06 8:20
professionalJoe Woodbury26-Apr-06 8:20 

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.