Click here to Skip to main content
15,914,767 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralGDI Question Pin
26-Oct-01 10:02
suss26-Oct-01 10:02 
GeneralRe: GDI Question Pin
Christian Graus26-Oct-01 10:53
protectorChristian Graus26-Oct-01 10:53 
GeneralResizing a view Pin
26-Oct-01 9:36
suss26-Oct-01 9:36 
GeneralRe: Resizing a view Pin
Navin26-Oct-01 9:45
Navin26-Oct-01 9:45 
GeneralRe: Resizing a view Pin
26-Oct-01 10:07
suss26-Oct-01 10:07 
GeneralChinese (.. or any DBCS) font problems Pin
Navin26-Oct-01 8:56
Navin26-Oct-01 8:56 
GeneralRe: Chinese (.. or any DBCS) font problems Pin
Carlos Antollini26-Oct-01 9:03
Carlos Antollini26-Oct-01 9:03 
GeneralRe: Chinese (.. or any DBCS) font problems Pin
Navin26-Oct-01 9:43
Navin26-Oct-01 9:43 
Well, what seems odd, is that, let's say I derive a control from CStatic (or make a custom control.) In my OnPaint handler, I have the code below, and it works fine! So it's not a problem with CString or Set/GetWindowText, or TextOut. It does make me wonder what a CStatic (or Windows static) control could possibly be doing that is messing this up?? Suspicious | :suss:

<br />
CPaintDC dc(this);<br />
<br />
CString str;<br />
CRect rect;<br />
<br />
GetWindowText(str);<br />
GetWindowRect(&rect);<br />
<br />
CSize textSize = dc.GetTextExtent(str);<br />
<br />
int x, y;<br />
x = rect.Width() / 2 - textSize.cx / 2;<br />
y = rect.Height() / 2 - textSize.cy / 2;<br />
<br />
dc.SetBkMode(TRANSPARENT);<br />
dc.SelectObject((CFont *)GetFont());<br />
dc.TextOut(x, y, str);<br />




The early bird may get the worm, but the second mouse gets the cheese.
Generalcalling applications in VC++ etc, Pin
JCY26-Oct-01 8:27
JCY26-Oct-01 8:27 
GeneralRe: calling applications in VC++ etc, Pin
Chris Losinger26-Oct-01 8:34
professionalChris Losinger26-Oct-01 8:34 
GeneralRe: calling applications in VC++ etc, Pin
Carlos Antollini26-Oct-01 8:56
Carlos Antollini26-Oct-01 8:56 
GeneralRe: calling applications in VC++ etc, Pin
Navin26-Oct-01 8:59
Navin26-Oct-01 8:59 
General(mfc) Checking a checkbox during CPropertyPage constructor Pin
Simon Walton26-Oct-01 6:27
Simon Walton26-Oct-01 6:27 
GeneralRe: (mfc) Checking a checkbox during CPropertyPage constructor Pin
Chris Losinger26-Oct-01 6:42
professionalChris Losinger26-Oct-01 6:42 
GeneralRe: (mfc) Checking a checkbox during CPropertyPage constructor Pin
Simon Walton26-Oct-01 7:13
Simon Walton26-Oct-01 7:13 
GeneralRe: (mfc) Checking a checkbox during CPropertyPage constructor Pin
Carlos Antollini26-Oct-01 6:52
Carlos Antollini26-Oct-01 6:52 
GeneralRe: (mfc) Checking a checkbox during CPropertyPage constructor Pin
Carlos Antollini26-Oct-01 6:54
Carlos Antollini26-Oct-01 6:54 
GeneralRe: (mfc) Checking a checkbox during CPropertyPage constructor Pin
Carlos Antollini26-Oct-01 6:56
Carlos Antollini26-Oct-01 6:56 
GeneralCMainFrame::PreCreateWindow(CREATESTRUCT& cs) Pin
vhalik26-Oct-01 6:06
vhalik26-Oct-01 6:06 
GeneralRe: CMainFrame::PreCreateWindow(CREATESTRUCT& cs) Pin
Fazlul Kabir26-Oct-01 6:36
Fazlul Kabir26-Oct-01 6:36 
GeneralRe: CMainFrame::PreCreateWindow(CREATESTRUCT& cs) Pin
vhalik26-Oct-01 6:39
vhalik26-Oct-01 6:39 
GeneralRe: CMainFrame::PreCreateWindow(CREATESTRUCT& cs) Pin
vhalik26-Oct-01 6:57
vhalik26-Oct-01 6:57 
GeneralRe: CMainFrame::PreCreateWindow(CREATESTRUCT& cs) Pin
Fazlul Kabir26-Oct-01 7:03
Fazlul Kabir26-Oct-01 7:03 
GeneralRe: CMainFrame::PreCreateWindow(CREATESTRUCT& cs) Pin
Fazlul Kabir26-Oct-01 7:40
Fazlul Kabir26-Oct-01 7:40 
GeneralRe: CMainFrame::PreCreateWindow(CREATESTRUCT& cs) Pin
vhalik26-Oct-01 7:50
vhalik26-Oct-01 7:50 

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.