From 575beaa8085aae45a6ad0a96bcec7fd04159d4f5 Mon Sep 17 00:00:00 2001 From: fcolin Date: Thu, 1 Feb 2007 13:03:08 +0000 Subject: Utilisateur : Fcolin Date : 2/02/01 Heure : 18:30 Archivé dans $/Ivy Commentaire: win CE compile not finished (vss 5) --- Bus/Ivy/IvySynchroWnd.cxx | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/Bus/Ivy/IvySynchroWnd.cxx b/Bus/Ivy/IvySynchroWnd.cxx index 12a4587..2ed6302 100644 --- a/Bus/Ivy/IvySynchroWnd.cxx +++ b/Bus/Ivy/IvySynchroWnd.cxx @@ -3,6 +3,12 @@ #include "stdafx.h" +#ifdef _DEBUG +#define DEBUG_NEW new(__FILE__, __LINE__) +#define new DEBUG_NEW +#endif + + #include "IvySynchroWnd.h" @@ -34,7 +40,7 @@ IvySynchroWnd::IvySynchroWnd() wc.hCursor = NULL; // predefined arrow wc.hbrBackground = 0; // white background brush wc.lpszMenuName = NULL; // no menu - wc.lpszClassName = "IvySynchroClass"; // name of window class + wc.lpszClassName = TEXT("IvySynchroClass"); // name of window class // Register the window class. @@ -45,7 +51,7 @@ IvySynchroWnd::IvySynchroWnd() } // Create the syncrho window. - m_hWnd = CreateWindowEx(0, "IvySynchroClass","Ivy Synchro Notification Sink", + m_hWnd = CreateWindowEx(0, TEXT("IvySynchroClass"), TEXT("Ivy Synchro Notification Sink"), WS_OVERLAPPED, 0, 0, 0, 0, NULL , NULL, NULL, NULL); if (!m_hWnd) { @@ -102,7 +108,7 @@ LRESULT IvySynchroWnd::OnIvyCB(WPARAM wParam, LPARAM lParam) void IvySynchroWnd::PostIvyCB( IvySynchronousCallback *cb ) { EnterCriticalSection( &m_CritSection ); - if ( !m_synchro->callbacklist.size() ) + if ( !m_synchro->callbacklist.empty() ) ASSERT(PostMessage(m_synchro->m_hWnd, WM_IVY_CB, 0, 0 )); m_synchro->callbacklist.push_back( cb ); LeaveCriticalSection( &m_CritSection ); @@ -126,7 +132,10 @@ void IvySynchronousMessageCallback::OnMessage(IvyApplication *app, int argc, con param->argc = argc; param->argv = new char*[argc]; for( int i = 0; i < argc ; i++ ) - param->argv[i] = strdup( argv[i]); + { + param->argv[i] = new char[ strlen( argv[i]) +1 ]; + strcpy( param->argv[i], argv[i]); + } // TRACE( "IvySynchronousMessageCallback::OnMessage msg count %d\n",wParam); m_synchro->PostIvyCB( param ); @@ -135,8 +144,8 @@ void IvySynchronousMessageCallback::CallCallback() { target->OnMessage( app, argc, (const char **) argv ); for( int i = 0; i < argc ; i++ ) - free( argv[i] ); // allocated with strdup - delete argv; // allocated with new + delete argv[i]; + delete argv; } -- cgit v1.1