diff options
-rw-r--r-- | Ivy/IvySynchroWnd.cxx | 21 |
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;
}
|