mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-09-08 14:17:06 +03:00
0028110: Configuration - specify Unicode charset instead of multibyte in project files for Visual Studio
Eliminated usage of ANSI methods. All Visual Studio projects generated by genproj or CMake use Unicode character set. Draw Harness now handles Unicode input on Windows. Tcl test scripts are now expected in UTF-8 encoding by default.
This commit is contained in:
@@ -14,35 +14,8 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
// *******************************************************************
|
||||
// RLN 06 January 2000
|
||||
// *******************************************************************
|
||||
// This file is built from former NTMain.pxx duplicated in many executables
|
||||
// extending DRAW Test Harness.
|
||||
// Now is implemented only in one instance.
|
||||
|
||||
// Differences between CAS.CADE versions:
|
||||
// - in C21 Draw_Appli is defined in Draw.cxx (DRAW UL) and calls externally
|
||||
// defined Draw_InitAppli. Moreover, on WNT Draw_Appli was not declared as
|
||||
// Standard_EXPORT and therefore it has to be duplicated explicitly in this
|
||||
// code as in Draw.cxx.
|
||||
// - in C30 Draw_Appli accepts Draw_InitAppli as parameter which is given to
|
||||
// it in each executable. Draw_Appli is declared as Standard_EXPORT and
|
||||
// therefore it needs not to be duplicated.
|
||||
|
||||
// To have only one instance of this file and to call it from all the executables
|
||||
// thereare defined macros in .hxx that replace main/WinMain functions and which
|
||||
// calls _main_/_WinMain_ defined in this file with specified Draw_InitAppli.
|
||||
// To avoid Unresolved symbols on WNT, Draw_InitAppli is explicitly defined in this
|
||||
// is initialized by main/_WinMain_.
|
||||
|
||||
// WARNING: Although versions C21 and C30 are synchronised as much as they can,
|
||||
// there are two versions of this file for both configurations. This is explained by:
|
||||
// - Standard_IMPOR is differently defined,
|
||||
// - Draw_Appli is differently declared.
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <windows.h> /* SW_SHOW */
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#include <Draw_Main.hxx>
|
||||
@@ -50,6 +23,7 @@
|
||||
#include <string.h>
|
||||
#include <Draw_Appli.hxx>
|
||||
#include <OSD.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
|
||||
#include <tcl.h>
|
||||
|
||||
@@ -94,18 +68,18 @@ extern Standard_Boolean Draw_IsConsoleSubsystem;
|
||||
Standard_Integer _main_ (int /*argc*/, char* argv[], char* /*envp*/[], const FDraw_InitAppli fDraw_InitAppli)
|
||||
{
|
||||
Draw_IsConsoleSubsystem = Standard_True;
|
||||
//return _WinMain_(::GetModuleHandle(NULL), NULL, GetCommandLine(), SW_SHOW, fDraw_InitAppli);
|
||||
theDraw_InitAppli = fDraw_InitAppli;
|
||||
//ParseCommandLine(GetCommandLine());
|
||||
|
||||
// MKV 01.02.05
|
||||
#if ((TCL_MAJOR_VERSION > 8) || ((TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4)))
|
||||
Tcl_FindExecutable(argv[0]);
|
||||
#endif
|
||||
|
||||
Draw_Appli(::GetModuleHandle(NULL), NULL, GetCommandLine(), SW_SHOW, fDraw_InitAppli);
|
||||
int aNbArgs = 0;
|
||||
wchar_t** anArgVec = CommandLineToArgvW (GetCommandLineW(), &aNbArgs);
|
||||
Draw_Appli (::GetModuleHandleW (NULL), NULL, SW_SHOW, aNbArgs, anArgVec, fDraw_InitAppli);
|
||||
LocalFree (anArgVec);
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -113,11 +87,13 @@ Standard_Integer _main_ (int /*argc*/, char* argv[], char* /*envp*/[], const FDr
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer _WinMain_ (HINSTANCE /*hInstance*/, HINSTANCE /*hPrevinstance*/, LPSTR /*lpCmdLine*/, int /*nCmdShow*/, const FDraw_InitAppli /*fDraw_InitAppli*/)
|
||||
Standard_Integer _WinMain_ (HINSTANCE hInstance, HINSTANCE hPrevinstance, LPSTR /*lpCmdLine*/, int nCmdShow, const FDraw_InitAppli fDraw_InitAppli)
|
||||
{
|
||||
// theDraw_InitAppli = fDraw_InitAppli;
|
||||
// ParseCommandLine (lpCmdLine);
|
||||
// Draw_Appli(hInstance, hPrevinstance, lpCmdLine, nCmdShow, Draw_InitAppli); // for C30;
|
||||
theDraw_InitAppli = fDraw_InitAppli;
|
||||
int aNbArgs = 0;
|
||||
wchar_t** anArgVec = CommandLineToArgvW(GetCommandLineW(), &aNbArgs);
|
||||
Draw_Appli (hInstance, hPrevinstance, nCmdShow, aNbArgs, anArgVec, fDraw_InitAppli);
|
||||
LocalFree (anArgVec);
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
@@ -136,4 +112,3 @@ Standard_Integer _main_ (Standard_Integer argc, char* argv[], const FDraw_InitAp
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
Reference in New Issue
Block a user