From: san Date: Wed, 4 Nov 2009 15:11:26 +0000 (+0000) Subject: Win32 UNICODE issues resolved X-Git-Tag: V2_3_0~10 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d50e695774e122a71de7477bf695c6c96c86755f;p=modules%2Fgui.git Win32 UNICODE issues resolved --- diff --git a/src/CAM/CAM_Application.cxx b/src/CAM/CAM_Application.cxx index 8e174969b..555cdd9f8 100755 --- a/src/CAM/CAM_Application.cxx +++ b/src/CAM/CAM_Application.cxx @@ -276,13 +276,21 @@ CAM_Module* CAM_Application::loadModule( const QString& modName, const bool show GET_MODULE_FUNC crtInst = 0; #ifdef WIN32 - HINSTANCE modLib = ::LoadLibrary( libName.toLatin1() ); +#ifdef UNICODE + HINSTANCE modLib = ::LoadLibrary( (LPTSTR)libName.utf16() ); +#else + HINSTANCE modLib = ::LoadLibrary( (LPTSTR)libName.toLatin1().constData() ); +#endif if ( !modLib ) { LPVOID lpMsgBuf; ::FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, 0, ::GetLastError(), 0, (LPTSTR)&lpMsgBuf, 0, 0 ); +#ifdef UNICODE + err = QString( "Failed to load %1. %2" ).arg( libName ).arg( QString::fromUtf16( (LPTSTR)lpMsgBuf ) ); +#else err = QString( "Failed to load %1. %2" ).arg( libName ).arg( (LPTSTR)lpMsgBuf ); +#endif ::LocalFree( lpMsgBuf ); } else @@ -293,7 +301,11 @@ CAM_Module* CAM_Application::loadModule( const QString& modName, const bool show LPVOID lpMsgBuf; ::FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, 0, ::GetLastError(), 0, (LPTSTR)&lpMsgBuf, 0, 0 ); +#ifdef UNICODE + err = QString( "Failed to find %1 function. %2" ).arg( GET_MODULE_NAME ).arg( QString::fromUtf16( (LPTSTR)lpMsgBuf ) ); +#else err = QString( "Failed to find %1 function. %2" ).arg( GET_MODULE_NAME ).arg( (LPTSTR)lpMsgBuf ); +#endif ::LocalFree( lpMsgBuf ); } }