diff options
author | fcolin | 2007-02-01 13:03:08 +0000 |
---|---|---|
committer | fcolin | 2007-02-01 13:03:08 +0000 |
commit | 575beaa8085aae45a6ad0a96bcec7fd04159d4f5 (patch) | |
tree | cb50bf0a7aa3bedab65e7fd709ad102bb7f38cd5 /Bus | |
parent | a8dcac14c962ef9064bda857e80e60cb0bc5908d (diff) | |
download | ivy-cplusplus-575beaa8085aae45a6ad0a96bcec7fd04159d4f5.zip ivy-cplusplus-575beaa8085aae45a6ad0a96bcec7fd04159d4f5.tar.gz ivy-cplusplus-575beaa8085aae45a6ad0a96bcec7fd04159d4f5.tar.bz2 ivy-cplusplus-575beaa8085aae45a6ad0a96bcec7fd04159d4f5.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 'Bus')
-rw-r--r-- | Bus/Ivy/IvySynchroWnd.cxx | 21 |
1 files 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;
}
|