]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Win32 UNICODE issues resolved
authorsan <san@opencascade.com>
Wed, 4 Nov 2009 15:11:26 +0000 (15:11 +0000)
committersan <san@opencascade.com>
Wed, 4 Nov 2009 15:11:26 +0000 (15:11 +0000)
src/CAM/CAM_Application.cxx

index 8e174969b5f80281a6cfce63bc2aea1cf5827fee..555cdd9f8f7eb77ab9cad29c87c603fbe29ee901 100755 (executable)
@@ -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 );
     }
   }