|
From: andrew7 <bd...@us...> - 2007-02-18 00:40:59
|
Update of /cvsroot/smartwin/SmartWin/source In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv26061/source Modified Files: Application.cpp Log Message: Allow wince to still work with one hInst for all. Index: Application.cpp =================================================================== RCS file: /cvsroot/smartwin/SmartWin/source/Application.cpp,v retrieving revision 1.44 retrieving revision 1.45 diff -u -d -r1.44 -r1.45 --- Application.cpp 7 Jan 2007 18:44:33 -0000 1.44 +++ Application.cpp 18 Feb 2007 00:40:54 -0000 1.45 @@ -258,6 +258,12 @@ } } +// Purpose is to generate a unique class name. +// If you have application with DLLs, there will be multiple instances, and +// multiple Application instances. +// except for WinCE, which used only one hInst for all. +// So we need an approach for WinCE that put the application handle in. +// void Application::generateLocalClassName( Seed & x_Seed ) { static unsigned int d_CurrentNo = 0; @@ -265,7 +271,11 @@ static Utilities::CriticalSection cs; Utilities::ThreadLock tmpLock( cs ); - d_ClassName << _T( "SW_" ) << d_CurrentNo++; +#ifdef WINCE + d_ClassName << _T( "SW_" ) << Application::instance().getAppHandle() << d_CurrentNo++; +#else + d_ClassName << _T( "SW_" ) << d_CurrentNo++; +#endif x_Seed.className = d_ClassName.str(); } |