Click here to Skip to main content
15,891,787 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Redirecting text to edit control Pin
Janine24-Jul-02 0:01
Janine24-Jul-02 0:01 
GeneralRe: Redirecting text to edit control Pin
Christian Graus24-Jul-02 2:28
protectorChristian Graus24-Jul-02 2:28 
GeneralRe: Redirecting text to edit control Pin
Janine24-Jul-02 2:42
Janine24-Jul-02 2:42 
GeneralRe: Redirecting text to edit control Pin
Christian Graus24-Jul-02 2:45
protectorChristian Graus24-Jul-02 2:45 
GeneralRe: Redirecting text to edit control Pin
Janine24-Jul-02 3:05
Janine24-Jul-02 3:05 
GeneralRe: Redirecting text to edit control Pin
Christian Graus25-Jul-02 2:39
protectorChristian Graus25-Jul-02 2:39 
GeneralRe: Redirecting text to edit control Pin
Janine25-Jul-02 3:27
Janine25-Jul-02 3:27 
GeneralRe: Redirecting text to edit control Pin
Daniel Lohmann23-Jul-02 23:18
Daniel Lohmann23-Jul-02 23:18 
To redirect printf is not that easy. I tried it the time I was writing the article
CEditLog - fast logging into an edit control with cout (which should also be quite useful to you), but failed. The internal structure of CRT streams (FILE*) is undocumented and to get it out of the sources is quite a long way.

However, If you have all sources available, the solution could be quite easy:

1) Write a printf-compatible function that prints out the output into the edit:

int printf_edit( const char* pszFormat, ... )
{
    ...
    // Write buffer to EditLog, maybe via std::cout
}


2) Add the following definitions to your stdafx.h (or in front of every .cpp file):

#undef printf
#define printf printf_edit

and recompile the whole thing.

--

Daniel Lohmann

http://www.losoft.de
GeneralRe: Redirecting text to edit control Pin
Janine24-Jul-02 2:24
Janine24-Jul-02 2:24 
GeneralRe: Redirecting text to edit control Pin
Mandalay24-Jul-02 2:02
Mandalay24-Jul-02 2:02 
GeneralSpreadsheet Programming Pin
Anonymous23-Jul-02 20:37
Anonymous23-Jul-02 20:37 
GeneralRe: Spreadsheet Programming Pin
NormDroid23-Jul-02 22:18
professionalNormDroid23-Jul-02 22:18 
GeneralChange process security context Pin
Don Miguel23-Jul-02 20:35
Don Miguel23-Jul-02 20:35 
GeneralRe: Change process security context Pin
Daniel Lohmann23-Jul-02 23:23
Daniel Lohmann23-Jul-02 23:23 
GeneralRe: Change process security context Pin
Don Miguel23-Jul-02 23:44
Don Miguel23-Jul-02 23:44 
GeneralRe: Change process security context Pin
Daniel Lohmann24-Jul-02 3:42
Daniel Lohmann24-Jul-02 3:42 
GeneralPass BYTE Array from VB to ATL COM Pin
Anonymous23-Jul-02 20:04
Anonymous23-Jul-02 20:04 
GeneralRe: Pass BYTE Array from VB to ATL COM Pin
Christian Graus23-Jul-02 20:22
protectorChristian Graus23-Jul-02 20:22 
GeneralRe: Pass BYTE Array from VB to ATL COM Pin
Anonymous23-Jul-02 20:39
Anonymous23-Jul-02 20:39 
QuestionHow to get properties of control. Pin
Raman Chilukuri23-Jul-02 19:16
Raman Chilukuri23-Jul-02 19:16 
QuestionHow can I do it in Mscomm control? Pin
glinda23-Jul-02 16:29
glinda23-Jul-02 16:29 
AnswerRe: How can I do it in Mscomm control? Pin
NormDroid23-Jul-02 22:24
professionalNormDroid23-Jul-02 22:24 
QuestionHow to Add Start menu shortcut in Setup program Pin
a3gupta23-Jul-02 15:22
a3gupta23-Jul-02 15:22 
AnswerRe: How to Add Start menu shortcut in Setup program Pin
super23-Jul-02 23:32
professionalsuper23-Jul-02 23:32 
GeneralRe: How to Add Start menu shortcut in Setup program Pin
a3gupta23-Jul-02 23:52
a3gupta23-Jul-02 23:52 

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.