1 #include "ace/CE_Screen_Output.h"
2 #if defined (ACE_HAS_WINCE)
4 #include "ace/Log_Category.h"
6 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
8 ACE_CE_Screen_Output::ACE_CE_Screen_Output(HWND hEdit
)
14 ACE_CE_Screen_Output::ACE_CE_Screen_Output()
20 ACE_CE_Screen_Output::~ACE_CE_Screen_Output()
27 void ACE_CE_Screen_Output::log(ACE_Log_Record
&log_record
)
29 ACE_TCHAR verbose_msg
[ACE_Log_Record::MAXVERBOSELOGMSGLEN
];
30 int result
= log_record
.format_msg (ACE_TEXT("WindozeCE"), // host name
36 verbose_msg
[ ACE_OS::strlen(verbose_msg
) - 1 ] = 0; // CE does not like '\n' by itself.
37 *this << verbose_msg
<< endl
;
41 void ACE_CE_Screen_Output::SetOutputWindow(HWND hEdit
)
46 void ACE_CE_Screen_Output::clear()
48 SetWindowText(handler_
, 0);
51 ACE_CE_Screen_Output
& ACE_CE_Screen_Output::operator << (ACE_TCHAR
* output
)
53 int length
= GetWindowTextLength(handler_
);
54 SendMessage(handler_
, EM_SETSEL
, length
, length
);
55 SendMessage(handler_
, EM_REPLACESEL
, 0, (LPARAM
)output
);
59 fwprintf(pFile_
, L
"%s", output
);
65 ACE_CE_Screen_Output
& ACE_CE_Screen_Output::operator << (const ACE_TCHAR
* output
)
67 ACE_TCHAR
* buffer
= ACE_OS::strdup(output
);
76 ACE_CE_Screen_Output
& ACE_CE_Screen_Output::operator << (ACE_ANTI_TCHAR
* output
)
78 *this << ACE_TEXT_CHAR_TO_TCHAR(output
);
82 ACE_CE_Screen_Output
& ACE_CE_Screen_Output::operator << (const ACE_ANTI_TCHAR
* output
)
84 *this << ACE_TEXT_CHAR_TO_TCHAR(output
);
88 ACE_CE_Screen_Output
& ACE_CE_Screen_Output::operator << (char output
)
94 ACE_CE_Screen_Output
& ACE_CE_Screen_Output::operator << (unsigned char output
)
100 ACE_CE_Screen_Output
& ACE_CE_Screen_Output::operator << (unsigned short output
)
102 ACE_TCHAR buffer
[20];
103 wsprintf(buffer
, ACE_TEXT("%u"), output
);
108 ACE_CE_Screen_Output
& ACE_CE_Screen_Output::operator << (int output
)
110 ACE_TCHAR buffer
[20];
111 wsprintf(buffer
, ACE_TEXT("%d"), output
);
116 ACE_CE_Screen_Output
& ACE_CE_Screen_Output::operator << (unsigned int output
)
118 ACE_TCHAR buffer
[20];
119 wsprintf(buffer
, ACE_TEXT("%du"), output
);
124 ACE_CE_Screen_Output
& ACE_CE_Screen_Output::operator << (float output
)
126 ACE_TCHAR buffer
[20];
127 swprintf(buffer
, ACE_TEXT("%f"), output
);
132 ACE_CE_Screen_Output
& ACE_CE_Screen_Output::operator << (long output
)
134 ACE_TCHAR buffer
[20];
135 wsprintf(buffer
, ACE_TEXT("%l"), output
);
140 ACE_CE_Screen_Output
& ACE_CE_Screen_Output::operator << (unsigned long output
)
142 ACE_TCHAR buffer
[20];
143 wsprintf(buffer
, ACE_TEXT("%lu"), output
);
148 ACE_CE_Screen_Output
& ACE_CE_Screen_Output::operator << (FILE* pFile
)
154 ACE_END_VERSIONED_NAMESPACE_DECL
156 #endif // ACE_HAS_WINCE