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

C / C++ / MFC

 
GeneralRe: Count Character in string Pin
manish.patel20-Nov-07 21:13
manish.patel20-Nov-07 21:13 
GeneralRe: Count Character in string Pin
Cedric Moonen20-Nov-07 21:44
Cedric Moonen20-Nov-07 21:44 
GeneralRe: Count Character in string (even faster) Pin
bolivar12321-Nov-07 3:06
bolivar12321-Nov-07 3:06 
QuestionCWnd Pin
kk.tvm20-Nov-07 19:07
kk.tvm20-Nov-07 19:07 
AnswerRe: CWnd Pin
Hamid_RT20-Nov-07 19:11
Hamid_RT20-Nov-07 19:11 
GeneralRe: CWnd Pin
kk.tvm20-Nov-07 21:11
kk.tvm20-Nov-07 21:11 
GeneralRe: CWnd Pin
Hamid_RT20-Nov-07 21:18
Hamid_RT20-Nov-07 21:18 
QuestionHow to SetWindowPos correctly? Actually confused with GetClientRect,GetWindowRect,ScreenToClient and ClientToScreen etc. Pin
fantasy121520-Nov-07 18:36
fantasy121520-Nov-07 18:36 
when create a dialog based MFC project defaultly, we have the OK, cancel buttons in the topright corner, I want to create a CListBox dynamicly and place it in the position relative to the IDOK button( the top cordination of CListBox is the same as IDOK), so I write my code like below:

first, construct a CListBox in the .h file
CListBox m_ctlBox;

then, within the OnInitDialog
BOOL CMyDialog::OnInitDialog()
{
  CDialog::OnInitDialog();
  m_ctlBox.Create(STYLE, CRect(0, 0, 0, 0), rightcode);
  m_ctlBox.ShowWindow(SW_HIDE);

  //below code to set the position for the CListBox
  CRect rcOK;
  GetDlgItem(IDOK)->GetWindowRect(&rcOK);
  int nBoxWidth = 30;
  int nBoxHeight = 40;
  int nxMargin = 10;
  int nBoxTop = rcOK.top;
  int nBoxLeft = rcOK.left - nxMargin - nBoxWidth;
  m_ctlBox.SetWindowPos(&CWnd::wndTop, nBoxLeft, nBoxTop, nBoxWidth, nBoxHeight, SWP_SHOWWINDOW);
  m_ctlBox.ShowWindow(SW_SHOW);
  return TRUE;
}

but the m_ctlBox's top is not as IDOK's. Really confused with how to use GetClientRect 、GetWindowRect、ScreenToClient and ClientToScreen correctly to set window position correctly.
So I can't write my code to deal with WM_SIZE correctly.
AnswerRe: How to SetWindowPos correctly? Actually confused with GetClientRect,GetWindowRect,ScreenToClient and ClientToScreen etc. Pin
Mark Salsbery20-Nov-07 19:01
Mark Salsbery20-Nov-07 19:01 
GeneralRe: How to SetWindowPos correctly? Actually confused with GetClientRect,GetWindowRect,ScreenToClient and ClientToScreen etc. [modified] Pin
fantasy121520-Nov-07 20:34
fantasy121520-Nov-07 20:34 
GeneralRe: How to SetWindowPos correctly? Actually confused with GetClientRect,GetWindowRect,ScreenToClient and ClientToScreen etc. Pin
Parthi_Appu21-Nov-07 0:25
Parthi_Appu21-Nov-07 0:25 
QuestionRe: How to SetWindowPos correctly? Actually confused with GetClientRect,GetWindowRect,ScreenToClient and ClientToScreen etc. [Understood clearly] Pin
fantasy121521-Nov-07 13:59
fantasy121521-Nov-07 13:59 
GeneralRe: How to SetWindowPos correctly? Actually confused with GetClientRect,GetWindowRect,ScreenToClient and ClientToScreen etc. Pin
Mark Salsbery21-Nov-07 5:15
Mark Salsbery21-Nov-07 5:15 
QuestionGetWindowText in OnKeyDown not correct Pin
followait20-Nov-07 18:26
followait20-Nov-07 18:26 
AnswerRe: GetWindowText in OnKeyDown not correct Pin
Hamid_RT20-Nov-07 18:35
Hamid_RT20-Nov-07 18:35 
GeneralRe: GetWindowText in OnKeyDown not correct Pin
followait20-Nov-07 18:40
followait20-Nov-07 18:40 
AnswerRe: GetWindowText in OnKeyDown not correct Pin
Haroon Sarwar20-Nov-07 18:36
Haroon Sarwar20-Nov-07 18:36 
GeneralRe: GetWindowText in OnKeyDown not correct Pin
followait20-Nov-07 18:40
followait20-Nov-07 18:40 
AnswerRe: GetWindowText in OnKeyDown not correct Pin
fantasy121520-Nov-07 18:42
fantasy121520-Nov-07 18:42 
Questiontchar to constant char mfc-vc++ Pin
Paulraj G20-Nov-07 17:46
Paulraj G20-Nov-07 17:46 
AnswerRe: tchar to constant char mfc-vc++ Pin
followait20-Nov-07 18:33
followait20-Nov-07 18:33 
QuestionRe: tchar to constant char mfc-vc++ Pin
nitin320-Nov-07 20:03
nitin320-Nov-07 20:03 
AnswerRe: tchar to constant char mfc-vc++ Pin
Cedric Moonen20-Nov-07 20:10
Cedric Moonen20-Nov-07 20:10 
GeneralRe: tchar to constant char mfc-vc++ Pin
Paulraj G21-Nov-07 23:43
Paulraj G21-Nov-07 23:43 
QuestionIE Addin Sample code Pin
Adam °Wimsatt20-Nov-07 15:59
Adam °Wimsatt20-Nov-07 15:59 

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.