summaryrefslogtreecommitdiff
path: root/Bus
diff options
context:
space:
mode:
authorfcolin2007-02-01 13:10:47 +0000
committerfcolin2007-02-01 13:10:47 +0000
commit62f11d551572492be3dfb0604271bc0aba69c1b7 (patch)
tree1ff69a3561d57b5c2ef998e7c33a47b5c55af8d8 /Bus
parentaa5eeaccec90f8e2545e626c4f38fc98f789d37f (diff)
downloadivy-cplusplus-62f11d551572492be3dfb0604271bc0aba69c1b7.zip
ivy-cplusplus-62f11d551572492be3dfb0604271bc0aba69c1b7.tar.gz
ivy-cplusplus-62f11d551572492be3dfb0604271bc0aba69c1b7.tar.bz2
ivy-cplusplus-62f11d551572492be3dfb0604271bc0aba69c1b7.tar.xz
Utilisateur : Fcolin Date : 19/02/01 Heure : 17:00 Archivé dans $/Bus/Test (vss 11)
Diffstat (limited to 'Bus')
-rw-r--r--Bus/IvyProbe/IvyProbeDlg.cpp25
1 files changed, 13 insertions, 12 deletions
diff --git a/Bus/IvyProbe/IvyProbeDlg.cpp b/Bus/IvyProbe/IvyProbeDlg.cpp
index 6982f2a..4a891d9 100644
--- a/Bus/IvyProbe/IvyProbeDlg.cpp
+++ b/Bus/IvyProbe/IvyProbeDlg.cpp
@@ -20,11 +20,12 @@ const char * CONVSTR( const CString& str )
static char buffer[4096];
int len = str.GetLength();
- buffer[0] = '\0';
+ buffer[len] = '\0';
if ( len )
{
- int err = WideCharToMultiByte( CP_ACP, WC_DEFAULTCHAR, str, len, buffer, 4096, "X", NULL );
- if ( err == 0 ) TRACE(TEXT("Error converting chars %d\n"),GetLastError());
+ int err = WideCharToMultiByte( CP_ACP, 0, str, len, buffer, 4096, NULL, NULL );
+ if ( err == 0 )
+ TRACE(TEXT("Error converting chars %d\n"),GetLastError());
}
return buffer;
#else
@@ -242,10 +243,10 @@ void CTestDlg::IvyCallback(IvyApplication *app, int argc, const char **argv)
int i;
CString text;
TRACE(TEXT(" Called function args:"));
- WriteMessage( TEXT("Ivy callback %d args"),argc );
+ WriteMessage( "Ivy callback %d args",argc );
for ( i = 0; i < argc; i++ )
{
- WriteMessage( TEXT(" arg%d='%s'"),i, argv[i] );
+ WriteMessage(" arg%d='%s'",i, argv[i] );
TRACE(TEXT(" '%s'"),argv[i]);
}
TRACE(TEXT("\n"));
@@ -301,19 +302,19 @@ TRACE(TEXT("Direct Msg Receive %d, %s\n"),id,arg );
void CTestDlg::OnApplicationConnected(IvyApplication *app)
{
- WriteMessage( TEXT("Application: %s ready"),(LPCSTR)(app->GetName()) );
+ WriteMessage( "Application: %s ready",(LPCSTR)(app->GetName()) );
}
void CTestDlg::OnApplicationDisconnected(IvyApplication *app)
{
- WriteMessage( TEXT("Application: %s bye"),(LPCSTR)(app->GetName()) );
+ WriteMessage( "Application: %s bye",(LPCSTR)(app->GetName()) );
}
-void CTestDlg::WriteMessage(LPCTSTR format, ...)
+void CTestDlg::WriteMessage(const char *format, ...)
{
- CString str;
+ char str[4096];
// format and write the data we were given
va_list args;
va_start(args, format);
- str.FormatV(format, args);
+ vsprintf(str, format, args);
m_text.AppendString( str );
}
@@ -340,7 +341,7 @@ void CTestDlg::OnSend()
{
m_msg.AddString( buffer );
}
- WriteMessage( TEXT("Sending %d message %s"),count,CONVSTR(buffer) );
+ WriteMessage( "Sending %d message %s",count,CONVSTR(buffer) );
m_msg.Clear();
}
@@ -355,6 +356,6 @@ void CTestDlg::OnBind()
{
m_expr.AddString( buffer );
}
- WriteMessage( TEXT("Binding to %s"), CONVSTR(buffer) );
+ WriteMessage( "Binding to %s", CONVSTR(buffer) );
m_expr.Clear();
}