WinCE compilation fixes
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34662 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
3a2f2e31bc
commit
858cab30be
@ -92,6 +92,21 @@ wxMessageOutput* wxMessageOutput::Set(wxMessageOutput* msgout)
|
|||||||
// wxMessageOutputBest
|
// wxMessageOutputBest
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
#ifdef __WINDOWS__
|
||||||
|
|
||||||
|
// check if we're running in a console under Windows
|
||||||
|
static inline bool IsInConsole()
|
||||||
|
{
|
||||||
|
#ifdef __WXWINCE__
|
||||||
|
return false;
|
||||||
|
#else // !__WXWINCE__
|
||||||
|
HANDLE hStdErr = ::GetStdHandle(STD_ERROR_HANDLE);
|
||||||
|
return hStdErr && hStdErr != INVALID_HANDLE_VALUE;
|
||||||
|
#endif // __WXWINCE__/!__WXWINCE__
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // __WINDOWS__
|
||||||
|
|
||||||
void wxMessageOutputBest::Printf(const wxChar* format, ...)
|
void wxMessageOutputBest::Printf(const wxChar* format, ...)
|
||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
@ -102,9 +117,7 @@ void wxMessageOutputBest::Printf(const wxChar* format, ...)
|
|||||||
va_end(args);
|
va_end(args);
|
||||||
|
|
||||||
#ifdef __WINDOWS__
|
#ifdef __WINDOWS__
|
||||||
// check if we're running in a console
|
if ( !IsInConsole() )
|
||||||
HANDLE hStdErr = ::GetStdHandle(STD_ERROR_HANDLE);
|
|
||||||
if ( !hStdErr || hStdErr == INVALID_HANDLE_VALUE )
|
|
||||||
{
|
{
|
||||||
::MessageBox(NULL, out, _T("wxWidgets"), MB_ICONINFORMATION | MB_OK);
|
::MessageBox(NULL, out, _T("wxWidgets"), MB_ICONINFORMATION | MB_OK);
|
||||||
}
|
}
|
||||||
|
@ -386,7 +386,7 @@ bool wxMenu::DoInsertOrAppend(wxMenuItem *pItem, size_t pos)
|
|||||||
if ( pos == (size_t)-1 )
|
if ( pos == (size_t)-1 )
|
||||||
{
|
{
|
||||||
// append at the end
|
// append at the end
|
||||||
pos = ::GetMenuItemCount(GetHmenu());
|
pos = GetMenuItemCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL ok = false;
|
BOOL ok = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user