Click here to Skip to main content
15,941,755 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Help getting templates converted from a VC6 to VS.NET 2003 Pin
Christian Graus24-Nov-03 15:26
protectorChristian Graus24-Nov-03 15:26 
GeneralRe: Help getting templates converted from a VC6 to VS.NET 2003 Pin
Anonymous24-Nov-03 15:31
Anonymous24-Nov-03 15:31 
GeneralRe: Help getting templates converted from a VC6 to VS.NET 2003 Pin
Christian Graus24-Nov-03 15:33
protectorChristian Graus24-Nov-03 15:33 
GeneralRe: Help getting templates converted from a VC6 to VS.NET 2003 Pin
Anonymous24-Nov-03 16:17
Anonymous24-Nov-03 16:17 
GeneralRe: Help getting templates converted from a VC6 to VS.NET 2003 Pin
Anonymous24-Nov-03 16:21
Anonymous24-Nov-03 16:21 
GeneralRe: Help getting templates converted from a VC6 to VS.NET 2003 Pin
Christian Graus24-Nov-03 16:44
protectorChristian Graus24-Nov-03 16:44 
GeneralRe: Help getting templates converted from a VC6 to VS.NET 2003 Pin
Anonymous24-Nov-03 17:11
Anonymous24-Nov-03 17:11 
GeneralRe: Help getting templates converted from a VC6 to VS.NET 2003 Pin
Christian Graus24-Nov-03 16:42
protectorChristian Graus24-Nov-03 16:42 
GeneralRe: Help getting templates converted from a VC6 to VS.NET 2003 Pin
Anonymous24-Nov-03 17:13
Anonymous24-Nov-03 17:13 
GeneralRe: Help getting templates converted from a VC6 to VS.NET 2003 Pin
John M. Drescher24-Nov-03 17:40
John M. Drescher24-Nov-03 17:40 
QuestionCDC::GetCharWidth ? Pin
Abin24-Nov-03 14:53
Abin24-Nov-03 14:53 
AnswerRe: CDC::GetCharWidth ? Pin
Christian Graus24-Nov-03 15:34
protectorChristian Graus24-Nov-03 15:34 
AnswerRe: CDC::GetCharWidth ? Pin
John R. Shaw24-Nov-03 16:49
John R. Shaw24-Nov-03 16:49 
There are some very good applications for GetCharWidth(), determining the display width of string is not one of them. Let's just say it is far more complicated than you want to know at this point in time.

If you need to know the display width and height of a string, use one of the text extent functions: GetTextExtent(), GetTabbedTextExtent(), etc...

Internaly the text extent functions may be calling GetCharWidth() to help in determining the size of the final bitmap image.

I have used GetCharWidth() in the past in order to create DOS style binary font bitmaps for Windows fonts (TT, etc...). That is only one of 2 situation that I found where this function is useful. Of cource if you could figure out what mathimatical algorythms are used to determine charater placement strings in Windows, then by all means write an acticle and let the rest of us know.

If you tried to use GetCharWidth() to determine the displayed legnth of a string, I'm here to tell you that it is not possible unless the font used is not variable spaced. If you dig into the subject you will find that you have to deal with thing like overhang, underhang, spacing between characters, and a whole host of other variables (depending on font type).

The short of it is that GetCharWidth() is only useful in a few specelized situation.

INTP
GeneralGreat Pin
Abin24-Nov-03 18:48
Abin24-Nov-03 18:48 
GeneralPrevent from closing Pin
Daniel132424-Nov-03 13:09
Daniel132424-Nov-03 13:09 
GeneralRe: Prevent from closing Pin
Christian Graus24-Nov-03 13:22
protectorChristian Graus24-Nov-03 13:22 
GeneralRe: Prevent from closing Pin
Daniel132424-Nov-03 13:24
Daniel132424-Nov-03 13:24 
GeneralRe: Prevent from closing Pin
Christian Graus24-Nov-03 13:27
protectorChristian Graus24-Nov-03 13:27 
GeneralEmbedded/C question Pin
Sirrius24-Nov-03 12:27
Sirrius24-Nov-03 12:27 
GeneralRe: Embedded/C question Pin
Christian Graus24-Nov-03 13:23
protectorChristian Graus24-Nov-03 13:23 
GeneralRe: Embedded/C question Pin
John R. Shaw24-Nov-03 17:01
John R. Shaw24-Nov-03 17:01 
GeneralRe: Embedded/C question Pin
l a u r e n24-Nov-03 13:42
l a u r e n24-Nov-03 13:42 
QuestionWinsock Layered Service provider on Win98??? Pin
Kuniva24-Nov-03 11:48
Kuniva24-Nov-03 11:48 
Generaldragable widgets Pin
john john mackey24-Nov-03 11:23
john john mackey24-Nov-03 11:23 
GeneralRe: dragable widgets Pin
john john mackey24-Nov-03 11:25
john john mackey24-Nov-03 11:25 

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.