| | |
| | | #include "ServoDlg.h" |
| | | #include "ServoGraph.h" |
| | | |
| | | using namespace Gdiplus; |
| | | // 声明全局变量,用于管理 GDI+ 初始化 |
| | | ULONG_PTR g_diplusToken; |
| | | GdiplusStartupInput g_diplusStartupInput; |
| | | |
| | | #ifdef _DEBUG |
| | | #define new DEBUG_NEW |
| | | #endif |
| | |
| | | HSMS_Initialize(); |
| | | |
| | | |
| | | // 初始化 GDI+ |
| | | InitGDIPlus(); |
| | | |
| | | |
| | | CServoDlg dlg; |
| | | m_pMainWnd = &dlg; |
| | | INT_PTR nResponse = dlg.DoModal(); |
| | |
| | | HSMS_Term(); |
| | | RX_Term(); |
| | | |
| | | // 清理 GDI+ |
| | | TermGDIPlus(); |
| | | |
| | | return CWinApp::ExitInstance(); |
| | | } |
| | | |
| | | // 初始化 GDI+ |
| | | void CServoApp::InitGDIPlus() |
| | | { |
| | | // 初始化 GDI+ 图形库 |
| | | GdiplusStartup(&g_diplusToken, &g_diplusStartupInput, NULL); |
| | | } |
| | | |
| | | // 清理 GDI+ |
| | | void CServoApp::TermGDIPlus() |
| | | { |
| | | // 清理 GDI+ 图形库 |
| | | GdiplusShutdown(g_diplusToken); |
| | | } |