Click here to Skip to main content
15,882,278 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
SuggestionRe: steganography source code in c Pin
Jochen Arndt10-Feb-15 23:17
professionalJochen Arndt10-Feb-15 23:17 
AnswerRe: steganography source code in c Pin
Chris Losinger11-Feb-15 5:07
professionalChris Losinger11-Feb-15 5:07 
AnswerRe: steganography source code in c Pin
CPallini11-Feb-15 10:23
mveCPallini11-Feb-15 10:23 
QuestionTool for automation Pin
Member 162132310-Feb-15 19:48
Member 162132310-Feb-15 19:48 
AnswerRe: Tool for automation Pin
Richard MacCutchan10-Feb-15 21:38
mveRichard MacCutchan10-Feb-15 21:38 
AnswerRe: Tool for automation Pin
Albert Holguin16-Feb-15 2:54
professionalAlbert Holguin16-Feb-15 2:54 
QuestionControls are flickering in MFC CView(MDI) Pin
D.Manivelan9-Feb-15 19:13
D.Manivelan9-Feb-15 19:13 
AnswerRe: Controls are flickering in MFC CView(MDI) Pin
Freak3010-Feb-15 1:09
Freak3010-Feb-15 1:09 
If I understand you correctly, you are calling SetWindowText() from onDraw(). This is a problem, because SetWindowText() invokes drawing of the control. So your apllication is permanently redrawing its GUI.

I would suggest that you store the values in the receiving function in a thread-safe way (look for CRITICAL_SECTION in the documentation). Then create a timer (look for SetTimer()) and in the timer function again in a thread-safe way copy the data to a local variable and display the copy with SetWindowText(). The OnTimer function could look something like this:
C++
void YourDialog::OnTimer(UINT nIDEvent)
{
    if (nIDEvent == YourTimerId)
    {
        EnterCriticalSection(&yourCriticalSection);
        CString values = sLiveValues;
        LeaveCriticalSection(&yourCriticalSection);
        GetDlgItem(IDC_EDITBOX)->SetWindowText(values);
    }
}

You can run the timer in any interval convenient for your users.
The good thing about pessimism is, that you are always either right or pleasently surprised.

QuestionDragging Pane Dividers in a Dialog Pin
Bram van Kampen8-Feb-15 12:40
Bram van Kampen8-Feb-15 12:40 
AnswerRe: Dragging Pane Dividers in a Dialog Pin
Richard Andrew x648-Feb-15 13:00
professionalRichard Andrew x648-Feb-15 13:00 
GeneralRe: Dragging Pane Dividers in a Dialog Pin
Bram van Kampen11-Feb-15 12:51
Bram van Kampen11-Feb-15 12:51 
QuestionI need help creating a custom 'allocator' for a STL set Pin
Member 114329606-Feb-15 4:42
Member 114329606-Feb-15 4:42 
AnswerRe: I need help creating a custom 'allocator' for a STL set Pin
Mike Nordell7-Feb-15 16:18
Mike Nordell7-Feb-15 16:18 
QuestionPointer address variation in c Pin
Member 114300955-Feb-15 5:11
Member 114300955-Feb-15 5:11 
AnswerRe: Pointer address variation in c PinPopular
Jochen Arndt5-Feb-15 5:26
professionalJochen Arndt5-Feb-15 5:26 
GeneralRe: Pointer address variation in c Pin
Frankie-C7-Feb-15 3:36
Frankie-C7-Feb-15 3:36 
GeneralRe: Pointer address variation in c Pin
Stefan_Lang11-Feb-15 23:20
Stefan_Lang11-Feb-15 23:20 
AnswerRe: Pointer address variation in c Pin
Randor 12-Feb-15 6:35
professional Randor 12-Feb-15 6:35 
GeneralRe: Pointer address variation in c Pin
Stefan_Lang12-Feb-15 20:43
Stefan_Lang12-Feb-15 20:43 
AnswerRe: Pointer address variation in c Pin
Mike Nordell7-Feb-15 16:22
Mike Nordell7-Feb-15 16:22 
AnswerRe: Pointer address variation in c Pin
Bram van Kampen15-Feb-15 15:35
Bram van Kampen15-Feb-15 15:35 
Questioncode Pin
Member 114292324-Feb-15 23:32
Member 114292324-Feb-15 23:32 
AnswerRe: code Pin
Richard MacCutchan4-Feb-15 23:57
mveRichard MacCutchan4-Feb-15 23:57 
AnswerRe: code Pin
Jochen Arndt5-Feb-15 0:15
professionalJochen Arndt5-Feb-15 0:15 
AnswerRe: code Pin
Afzaal Ahmad Zeeshan5-Feb-15 0:15
professionalAfzaal Ahmad Zeeshan5-Feb-15 0:15 

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.