## 直接构建VisualStudio的.sln文件 gn gen out/sln --ide=vs
静态 debug gn gen out/Clang --args="cxx=\"clang++\" cc=\"clang\" is_debug=true"
静态 release gn gen out/Clang_release --args="cxx=\"clang++\" cc=\"clang\" is_debug=false"
bin/gn gen out/Shared --args='is_official_build=true is_component_build=true' --ide=vs bin\gn gen out/Static_x86 --args="clang_win=\"C:\Program Files\LLVM\" target_cpu=\"x86\" is_debug=false is_official_build=true skia_use_system_expat=false skia_use_system_libjpeg_turbo=false skia_use_system_libpng=false skia_use_system_libwebp=false skia_use_system_zlib=false"
bin/gn gen out/Debug bin/gn gen out/Release --args='is_debug=false' bin/gn gen out/Clang --args='cc="clang" cxx="clang++"' bin/gn gen out/Cached --args='cc_wrapper="ccache"' bin/gn gen out/RTTI --args='extra_cflags_cc=["-frtti"]'
BOOL CMRLGaugerDrawerDlg::PreTranslateMessage(MSG* pMsg) { if (pMsg->message == WM_KEYDOWN) { if (pMsg->wParam == VK_RETURN || pMsg->wParam == VK_ESCAPE) { // Do not process further return TRUE; } }
return CDialogEx::PreTranslateMessage(pMsg); }
设置标题文字
#define APP_VERSION ("serial port tool version: 2020.02.19-1341")
BOOL CMRLGaugerDrawerDlg::PreTranslateMessage(MSG* pMsg) { if (pMsg->message == WM_KEYDOWN) { if (pMsg->wParam == VK_RETURN || pMsg->wParam == VK_ESCAPE) { // Do not process further return TRUE; } }
return CDialogEx::PreTranslateMessage(pMsg); }
设置标题文字
#define APP_VERSION ("serial port tool version: 2020.02.19-1341")
voidbar(int& x, int& out) { int m = 0; CString str; for (int i = 0; i < 5; ++i) { m += x; str.Format(L"bar %d\n", i); OutputDebugString(str); Sleep(1000); } out = m; }
intmain() { CString str;
std::thread first(foo); // spawn new thread that calls foo() int out = 0; int in = 10; std::thread second(bar, ref(in),ref(out)); // spawn new thread that calls bar(0)
OutputDebugString(L"main, foo and bar now execute concurrently...\n");
// synchronize threads: first.join(); // pauses until first finishes second.join(); // pauses until second finishes
str.Format(L"foo and bar completed. out:%d\n", out);