diff --git a/API_General.cpp b/API_General.cpp index af1a717..26a0868 100644 --- a/API_General.cpp +++ b/API_General.cpp @@ -192,3 +192,29 @@ __stdcall EgtSetProcessEvents( pfProcEvents pFun) { return ( ExeSetProcessEvents( pFun) ? TRUE : FALSE) ; } + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +static pfOutTextW s_pFunOutText = nullptr ; + +//----------------------------------------------------------------------------- +bool +__stdcall MyOutText( const string& sText) +{ + if ( s_pFunOutText == nullptr) + return false ; + wchar_t* wsText = _wcsdup( stringtoW( sText)) ; + if ( wsText == nullptr) + return false ; + BOOL bOk = s_pFunOutText( wsText) ; + free( wsText) ; + return ( bOk != FALSE) ; +} + +//----------------------------------------------------------------------------- +BOOL +__stdcall EgtSetOutText( pfOutTextW pFun) +{ + s_pFunOutText = pFun ; + return ( ExeSetOutText( (( pFun != nullptr) ? MyOutText : nullptr)) ? TRUE : FALSE) ; +} diff --git a/EgtInterface.rc b/EgtInterface.rc index 7ec868d..2edbcbb 100644 Binary files a/EgtInterface.rc and b/EgtInterface.rc differ