GET_VERSION_FUNC getVersion = 0;
#ifdef WIN32
-
#ifdef UNICODE
LPTSTR str_libname = new TCHAR[libName.length() + 1];
str_libname[libName.toWCharArray(str_libname)] = '\0';
-#else
- LPTSTR str_libname = libName.toLatin1().constData();
+#else
+ QByteArray arr = libName.toLatin1();
+ LPTSTR str_libname = arr.constData();
#endif
HINSTANCE modLib = ::LoadLibrary( str_libname );
+#ifdef UNICODE
+ delete str_libname;
+#endif
if ( !modLib )
{
LPVOID lpMsgBuf;
LPTSTR str = new TCHAR[aText.length() + 1];
str[aText.toWCharArray(str)] = '\0';
#else
- LPTSTR str = aText.toLatin1().constData();
+ QByteArray arr = FileName.toLatin1();
+ LPTSTR str = arr.constData();
#endif
TextOut( dc, x, y, str, aText.length() );
+#ifdef UNICODE
+ delete str;
+#endif
SelectObject ( dc, old1 );
SelectObject ( dc, old2 );
HDC bitDC = CreateCompatibleDC ( screen_dc ); //The context compatible with screen
#ifdef UNICODE
- LPTSTR str = new TCHAR[FileName.length() + 1];
- str[FileName.toWCharArray(str)] = '\0';
- LPTSTR empty = L"";
+ LPTSTR str = new TCHAR[FileName.length() + 1];
+ str[FileName.toWCharArray(str)] = '\0';
+ LPTSTR empty = L"";
#else
- LPTSTR str = FileName.toLatin1().constData();
- LPTSTR empty = "";
+ QByteArray arr = FileName.toLatin1();
+ LPTSTR str = arr.constData();
+ LPTSTR empty = "";
#endif
hMetaFileDC = CreateEnhMetaFile( bitDC, str, &r, empty );
+#ifdef UNICODE
+ delete str;
+#endif
SetMapMode( hMetaFileDC, MM_HIMETRIC );
SetWindowOrgEx( hMetaFileDC, 0, r.bottom, NULL );
HRGN ClipRgn = CreateRectRgn( 0, 0, AW, AH );
ReleaseDC( 0, screen_dc );
DeleteDC( bitDC );
- aCurVP->getGLWidget()->translateBackgroundToEMF( hMetaFileDC, &aViewerCS, &aPaperCS );
+ aCurVP->getGLWidget()->translateBackgroundToEMF( hMetaFileDC, &aViewerCS, &aPaperCS );
}
#endif