StrokeSeg 1.0.0
Loading...
Searching...
No Matches
main.cpp
1#include "consoleAllocator.h"
2#include "executors.h"
3#include "commandLineTools.h"
4
44
53int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
54{
55 int argc = 0;
56 std::filesystem::path currentExecutableDirPath;
57 std::filesystem::path pythonExecutablePath;
58
59 LPWSTR* argvW = extractAndCheck(argc, currentExecutableDirPath, pythonExecutablePath);
60
61 if (argvW)
62 {
63 bool console = false;
64 std::wstring commandLine = commandLineConverter(APP_RELATIVE_PATH, pythonExecutablePath, argvW, argc, console);
65
66 if (!console)
67 {
68 execWitoutConsole(commandLine, currentExecutableDirPath.wstring());
69 }
70 else
71 {
72 int consoleSatus = allocateConsole(TEXT("Stroke Seg Console"));
73 execWithConsole(commandLine, currentExecutableDirPath.wstring(), consoleSatus);
74 }
75 }
76 else
77 {
78 return 1; // If argvW is nullptr, an error message has already been displayed in extractAndCheck.
79 }
80
81 LocalFree(argvW); // Free the memory allocated by CommandLineToArgvW
82
83 return 0;
84}
Header file for the CommandLineTools module. This file contains declarations for functions related to...
Header file for console allocation functions. This file contains declarations for functions that allo...
Header file for the executors module. This file contains declarations for functions related to launch...