Click here to Skip to main content
14,576,897 members

C / C++ / MFC

 
GeneralRe: QueryPerformanceCounter Pin
CalinNegru16-May-20 3:11
MemberCalinNegru16-May-20 3:11 
AnswerRe: QueryPerformanceCounter Pin
Richard MacCutchan16-May-20 2:58
mveRichard MacCutchan16-May-20 2:58 
GeneralRe: QueryPerformanceCounter Pin
CalinNegru16-May-20 23:00
MemberCalinNegru16-May-20 23:00 
GeneralProject Pin
Hayley Satjan15-May-20 0:32
MemberHayley Satjan15-May-20 0:32 
GeneralRe: Project Pin
Richard MacCutchan15-May-20 0:51
mveRichard MacCutchan15-May-20 0:51 
GeneralRe: Project Pin
CPallini15-May-20 1:44
mveCPallini15-May-20 1:44 
GeneralRe: Project Pin
charlieg18-May-20 12:59
Membercharlieg18-May-20 12:59 
QuestionCaret not displayed in CEdit control with focus when dialog initially displayed Pin
Member 1106593314-May-20 23:35
MemberMember 1106593314-May-20 23:35 
I have a CDialog derived dialog which has a CFormView derived member which has a number of CEdit derived controls placed on it.

Based on business rules at runtime one of the CEdit derived controls should receive the focus when the dialog is displayed. In the OnInitialUpdate override of the CFormView derived class the specfic control is determined and focus is set to that control with the following call:
PostMessage(WM_NEXTDLGCTL, (WPARAM)pFocusEdit->GetSafeHwnd(), TRUE);

When the dialog is displayed there is no caret displayed within the control. It is outlined in the blue colour showing that it has focus, if I start typing the text is displayed but still no caret. If I TAB to the next control the caret is displayed there and if I TAB back it is now displayed in the originally focused control.
Alternatively, after the dialog is initially displayed and the caret is not showing If I shift the active window to another app (e.g. visual studio) and then actiavte the app again then the caret does appear in the CEdit control.

Any suggestions as to how I can ensure that the desired CEdit control receives focus on display of the dialog and that the caret is displayed?

Thanks,
AnswerRe: Caret not displayed in CEdit control with focus when dialog initially displayed Pin
Richard MacCutchan14-May-20 23:53
mveRichard MacCutchan14-May-20 23:53 
GeneralRe: Caret not displayed in CEdit control with focus when dialog initially displayed Pin
Member 1106593315-May-20 0:36
MemberMember 1106593315-May-20 0:36 
GeneralRe: Caret not displayed in CEdit control with focus when dialog initially displayed Pin
Richard MacCutchan15-May-20 0:48
mveRichard MacCutchan15-May-20 0:48 
QuestionPossible to #if in case an enum exists? Pin
arnold_w11-May-20 22:21
Memberarnold_w11-May-20 22:21 
AnswerRe: Possible to #if in case an enum exists? Pin
CPallini11-May-20 22:48
mveCPallini11-May-20 22:48 
AnswerRe: Possible to #if in case an enum exists? Pin
Richard MacCutchan11-May-20 23:29
mveRichard MacCutchan11-May-20 23:29 
GeneralRe: Possible to #if in case an enum exists? Pin
Greg Utas15-May-20 0:22
professionalGreg Utas15-May-20 0:22 
GeneralRe: Possible to #if in case an enum exists? Pin
Richard MacCutchan15-May-20 0:29
mveRichard MacCutchan15-May-20 0:29 
QuestionReading sectors Pin
_Flaviu8-May-20 5:46
Member_Flaviu8-May-20 5:46 
AnswerRe: Reading sectors Pin
Victor Nijegorodov8-May-20 6:15
MemberVictor Nijegorodov8-May-20 6:15 
GeneralRe: Reading sectors Pin
_Flaviu9-May-20 19:55
Member_Flaviu9-May-20 19:55 
GeneralRe: Reading sectors Pin
Victor Nijegorodov9-May-20 20:49
MemberVictor Nijegorodov9-May-20 20:49 
GeneralRe: Reading sectors Pin
_Flaviu9-May-20 21:21
Member_Flaviu9-May-20 21:21 
AnswerRe: Reading sectors Pin
Graham Breach8-May-20 6:22
MemberGraham Breach8-May-20 6:22 
AnswerRe: Reading sectors Pin
Richard MacCutchan8-May-20 6:46
mveRichard MacCutchan8-May-20 6:46 
GeneralRe: Reading sectors Pin
_Flaviu9-May-20 20:31
Member_Flaviu9-May-20 20:31 
GeneralRe: Reading sectors Pin
Richard MacCutchan9-May-20 21:32
mveRichard MacCutchan9-May-20 21:32 

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.