mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-05-11 02:16:00 +02:00
better print
Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
parent
4e7a8065b9
commit
a023764bfd
2 changed files with 9 additions and 5 deletions
|
@ -22,7 +22,7 @@ import texture_rgba_renderer
|
||||||
class MainFlutterWindow: NSWindow {
|
class MainFlutterWindow: NSWindow {
|
||||||
override func awakeFromNib() {
|
override func awakeFromNib() {
|
||||||
if (!rustdesk_core_main()){
|
if (!rustdesk_core_main()){
|
||||||
print("Rustdesk core returns false, exiting without launching Flutter app")
|
print("Rustdesk core returns false, exiting without launching Flutter app.")
|
||||||
NSApplication.shared.terminate(self)
|
NSApplication.shared.terminate(self)
|
||||||
}
|
}
|
||||||
let flutterViewController = FlutterViewController.init()
|
let flutterViewController = FlutterViewController.init()
|
||||||
|
|
|
@ -22,21 +22,21 @@ int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev,
|
||||||
HINSTANCE hInstance = LoadLibraryA("librustdesk.dll");
|
HINSTANCE hInstance = LoadLibraryA("librustdesk.dll");
|
||||||
if (!hInstance)
|
if (!hInstance)
|
||||||
{
|
{
|
||||||
std::cout << "Failed to load librustdesk.dll" << std::endl;
|
std::cout << "Failed to load librustdesk.dll." << std::endl;
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
FUNC_RUSTDESK_CORE_MAIN rustdesk_core_main =
|
FUNC_RUSTDESK_CORE_MAIN rustdesk_core_main =
|
||||||
(FUNC_RUSTDESK_CORE_MAIN)GetProcAddress(hInstance, "rustdesk_core_main_args");
|
(FUNC_RUSTDESK_CORE_MAIN)GetProcAddress(hInstance, "rustdesk_core_main_args");
|
||||||
if (!rustdesk_core_main)
|
if (!rustdesk_core_main)
|
||||||
{
|
{
|
||||||
std::cout << "Failed to get rustdesk_core_main" << std::endl;
|
std::cout << "Failed to get rustdesk_core_main." << std::endl;
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
FUNC_RUSTDESK_FREE_ARGS free_c_args =
|
FUNC_RUSTDESK_FREE_ARGS free_c_args =
|
||||||
(FUNC_RUSTDESK_FREE_ARGS)GetProcAddress(hInstance, "free_c_args");
|
(FUNC_RUSTDESK_FREE_ARGS)GetProcAddress(hInstance, "free_c_args");
|
||||||
if (!free_c_args)
|
if (!free_c_args)
|
||||||
{
|
{
|
||||||
std::cout << "Failed to get free_c_args" << std::endl;
|
std::cout << "Failed to get free_c_args." << std::endl;
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
std::vector<std::string> command_line_arguments =
|
std::vector<std::string> command_line_arguments =
|
||||||
|
@ -50,7 +50,11 @@ int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev,
|
||||||
char** c_args = rustdesk_core_main(&args_len);
|
char** c_args = rustdesk_core_main(&args_len);
|
||||||
if (!c_args)
|
if (!c_args)
|
||||||
{
|
{
|
||||||
std::cout << "Rustdesk core returns false, exiting without launching Flutter app" << std::endl;
|
std::string args_str = "";
|
||||||
|
for (const auto& argument : command_line_arguments) {
|
||||||
|
args_str += (argument + " ");
|
||||||
|
}
|
||||||
|
std::cout << "Rustdesk [" << args_str << "], core returns false, exiting without launching Flutter app." << std::endl;
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
std::vector<std::string> rust_args(c_args, c_args + args_len);
|
std::vector<std::string> rust_args(c_args, c_args + args_len);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue