summaryrefslogtreecommitdiff
path: root/Ivy/IvySynchroWnd.cxx
diff options
context:
space:
mode:
authorfcolin2007-02-01 13:03:08 +0000
committerfcolin2007-02-01 13:03:08 +0000
commit897f96895828f2e58459d5a3c7ef57ca652982c5 (patch)
treeb895349c908487aae4b5a311fcaa3d315f6152f6 /Ivy/IvySynchroWnd.cxx
parent5aba50d0f42fbe91363d0e06d298ddbccd8df961 (diff)
downloadivy-cplusplus-897f96895828f2e58459d5a3c7ef57ca652982c5.zip
ivy-cplusplus-897f96895828f2e58459d5a3c7ef57ca652982c5.tar.gz
ivy-cplusplus-897f96895828f2e58459d5a3c7ef57ca652982c5.tar.bz2
ivy-cplusplus-897f96895828f2e58459d5a3c7ef57ca652982c5.tar.xz
Utilisateur : Fcolin Date : 2/02/01 Heure : 18:30 Archivé dans $/Ivy Commentaire: win CE compile not finished (vss 5)
Diffstat (limited to 'Ivy/IvySynchroWnd.cxx')
-rw-r--r--Ivy/IvySynchroWnd.cxx21
1 files changed, 15 insertions, 6 deletions
diff --git a/Ivy/IvySynchroWnd.cxx b/Ivy/IvySynchroWnd.cxx
index 12a4587..2ed6302 100644
--- a/Ivy/IvySynchroWnd.cxx
+++ b/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;
}