From 3ef188e6075649f4c72e3e7588d8966e1071f2ff Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期五, 05 七月 2024 15:50:40 +0800 Subject: [PATCH] update .gitignore --- CBTrade/main.cpp | 34 ++++++++++++++++++++++++++++++---- 1 files changed, 30 insertions(+), 4 deletions(-) diff --git a/CBTrade/main.cpp b/CBTrade/main.cpp index c85abda..4ab87e2 100644 --- a/CBTrade/main.cpp +++ b/CBTrade/main.cpp @@ -4,6 +4,8 @@ #include "MainFrame.h" +#include "MyConfigUtil.h" + class App :public wxApp { @@ -14,14 +16,38 @@ /// 初始化函数 /// </summary> void InitData() { - MyNetworkApi::set_server_info("43.138.167.68", 13008,"43.138.167.68", 13008); - //MyNetworkApi::set_server_info("192.168.3.122", 13008, "192.168.3.122", 13008); - MyNetworkApi::get_all_positions(); + } + + + static void unhandled_exception_handler() { + try { + throw; // Re-throw the exception to handle it + } + catch (const std::exception& e) { + std::cerr << "Caught std::exception: " << e.what() << std::endl; + } + catch (...) { + std::cerr << "Caught unknown exception" << std::endl; + } + std::abort(); // Terminate the program } bool OnInit() { + std::set_terminate(unhandled_exception_handler); InitData(); - MainFrame* window = new MainFrame("可转债交易"); + SetProcessDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2); + MainFrame* window; + WindowPosSize rect = MyConfigUtil::getMainWindowPos(); + cout << "获取到的坐标:" << rect.x << " " << rect.y << endl; + if (rect.x == -1 && rect.y == -1) { + window = new MainFrame("可转债交易"); + } + else { + wxPoint p = wxPoint(rect.x, rect.y); + cout << "设置的坐标:" << p.x << " " << p.y << endl; + wxSize s = wxSize(rect.width, rect.height); + window = new MainFrame("可转债交易",p,s); + } window->Show(); return true; } -- Gitblit v1.8.0