MFC串口通信

上传者: kwb0523 | 上传时间: 2023-01-06 10:13:49 | 文件大小: 57.42MB | 文件类型: ZIP
MFC串口通信程序代码,含界面 // 串口通信.cpp : 定义应用程序的类行为。 // #include "stdafx.h" #include "串口通信.h" #include "串口通信Dlg.h" #ifdef _DEBUG #define new DEBUG_NEW #endif // C串口通信App BEGIN_MESSAGE_MAP(C串口通信App, CWinApp) ON_COMMAND(ID_HELP, &CWinApp::OnHelp) END_MESSAGE_MAP() // C串口通信App 构造 C串口通信App::C串口通信App() { // 支持重新启动管理器 m_dwRestartManagerSupportFlags = AFX_RESTART_MANAGER_SUPPORT_RESTART; // TODO: 在此处添加构造代码, // 将所有重要的初始化放置在 InitInstance 中 } // 唯一的一个 C串口通信App 对象 C串口通信App theApp; // C串口通信App 初始化 BOOL C串口通信App::InitInstance() { // 如果一个运行在 Windows XP 上的应用程序清单指定要 // 使用 ComCtl32.dll 版本 6 或更高版本来启用可视化方式, //则需要 InitCommonControlsEx()。 否则,将无法创建窗口。 INITCOMMONCONTROLSEX InitCtrls; InitCtrls.dwSize = sizeof(InitCtrls); // 将它设置为包括所有要在应用程序中使用的 // 公共控件类。 InitCtrls.dwICC = ICC_WIN95_CLASSES; InitCommonControlsEx(&InitCtrls); CWinApp::InitInstance(); AfxEnableControlContainer(); // 创建 shell 管理器,以防对话框包含 // 任何 shell 树视图控件或 shell 列表视图控件。 CShellManager *pShellManager = new CShellManager; // 激活“Windows Native”视觉管理器,以便在 MFC 控件中启用主题 CMFCVisualManager::SetDefaultManager(RUNTIME_CLASS(CMFCVisualManagerWindows)); // 标准初始化 // 如果未使用这些功能并希望减小 // 最终可执行文件的大小,则应移除下列 // 不需要的特定初始化例程 // 更改用于存储设置的注册表项 // TODO: 应适当修改该字符串, // 例如修改为公司或组织名 SetRegistryKey(_T("应用程序向导生成的本地应用程序")); C串口通信Dlg dlg; m_pMainWnd = &dlg; INT_PTR nResponse = dlg.DoModal(); if (nResponse == IDOK) { // TODO: 在此放置处理何时用 // “确定”来关闭对话框的代码 } else if (nResponse == IDCANCEL) { // TODO: 在此放置处理何时用 // “取消”来关闭对话框的代码 } else if (nResponse == -1) { TRACE(traceAppMsg, 0, "警告: 对话框创建失败,应用程序将意外终止。\n"); TRACE(traceAppMsg, 0, "警告: 如果您在对话框上使用 MFC 控件,则无法 #define _AFX_NO_MFC_CONTROLS_IN_DIALOGS。\n"); } // 删除上面创建的 shell 管理器。 if (pShellManager != NULL) { delete pShellManager; } // 由于对话框已关闭,所以将返回 FALSE 以便退出应用程序, // 而不是启动应用程序的消息泵。 return FALSE; }

文件下载

资源详情

[{"title":"( 44 个子文件 57.42MB ) MFC串口通信","children":[{"title":"串口通信实例","children":[{"title":"串口通信.v12.suo <span style='color:#111;'> 32.00KB </span>","children":null,"spread":false},{"title":"串口通信.sln <span style='color:#111;'> 982B </span>","children":null,"spread":false},{"title":"串口通信.sdf <span style='color:#111;'> 75.75MB </span>","children":null,"spread":false},{"title":"ipch","children":[{"title":"串口通信-38257bc","children":[{"title":"串口通信-378991c.ipch <span style='color:#111;'> 89.69MB </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"Debug","children":[{"title":"串口通信.pdb <span style='color:#111;'> 6.65MB </span>","children":null,"spread":false},{"title":"串口通信.exe <span style='color:#111;'> 193.50KB </span>","children":null,"spread":false},{"title":"串口通信.ilk <span style='color:#111;'> 1.26MB </span>","children":null,"spread":false}],"spread":true},{"title":"串口通信","children":[{"title":"stdafx.cpp <span style='color:#111;'> 141B </span>","children":null,"spread":false},{"title":"串口通信.aps <span style='color:#111;'> 106.74KB </span>","children":null,"spread":false},{"title":"res","children":[{"title":"1.png <span style='color:#111;'> 19.22KB </span>","children":null,"spread":false},{"title":"My.rc2 <span style='color:#111;'> 660B </span>","children":null,"spread":false},{"title":"串口通信.ico <span style='color:#111;'> 66.19KB </span>","children":null,"spread":false}],"spread":true},{"title":"stdafx.h <span style='color:#111;'> 1.54KB </span>","children":null,"spread":false},{"title":"串口通信Dlg.cpp <span style='color:#111;'> 7.14KB </span>","children":null,"spread":false},{"title":"mscomm1.h <span style='color:#111;'> 11.32KB </span>","children":null,"spread":false},{"title":"targetver.h <span style='color:#111;'> 234B </span>","children":null,"spread":false},{"title":"串口通信.rc <span style='color:#111;'> 13.11KB </span>","children":null,"spread":false},{"title":"串口通信.cpp <span style='color:#111;'> 2.34KB </span>","children":null,"spread":false},{"title":"串口通信.h <span style='color:#111;'> 455B </span>","children":null,"spread":false},{"title":"resource.h <span style='color:#111;'> 2.10KB </span>","children":null,"spread":false},{"title":"mscomm1.cpp <span style='color:#111;'> 547B </span>","children":null,"spread":false},{"title":"串口通信.vcxproj <span style='color:#111;'> 6.17KB </span>","children":null,"spread":false},{"title":"串口通信Dlg.h <span style='color:#111;'> 1.01KB </span>","children":null,"spread":false},{"title":"串口通信.vcxproj.filters <span style='color:#111;'> 2.21KB </span>","children":null,"spread":false},{"title":"Debug","children":[{"title":"串口通信.pch <span style='color:#111;'> 41.19MB </span>","children":null,"spread":false},{"title":"vc120.pdb <span style='color:#111;'> 6.35MB </span>","children":null,"spread":false},{"title":"stdafx.obj <span style='color:#111;'> 892.25KB </span>","children":null,"spread":false},{"title":"串口通信.res <span style='color:#111;'> 68.51KB </span>","children":null,"spread":false},{"title":"mscomm1.obj <span style='color:#111;'> 28.03KB </span>","children":null,"spread":false},{"title":"串口通信.log <span style='color:#111;'> 2.10KB </span>","children":null,"spread":false},{"title":"vc120.idb <span style='color:#111;'> 2.20MB </span>","children":null,"spread":false},{"title":"串口通信.tlog","children":[{"title":"CL.write.1.tlog <span style='color:#111;'> 2.87KB </span>","children":null,"spread":false},{"title":"CL.read.1.tlog <span style='color:#111;'> 71.04KB </span>","children":null,"spread":false},{"title":"rc.write.1.tlog <span style='color:#111;'> 218B </span>","children":null,"spread":false},{"title":"rc.read.1.tlog <span style='color:#111;'> 2.70KB </span>","children":null,"spread":false},{"title":"cl.command.1.tlog <span style='color:#111;'> 2.80KB </span>","children":null,"spread":false},{"title":"link.write.1.tlog <span style='color:#111;'> 894B </span>","children":null,"spread":false},{"title":"link.command.1.tlog <span style='color:#111;'> 1.66KB </span>","children":null,"spread":false},{"title":"串口通信.lastbuildstate <span style='color:#111;'> 177B </span>","children":null,"spread":false},{"title":"rc.command.1.tlog <span style='color:#111;'> 592B </span>","children":null,"spread":false},{"title":"link.read.1.tlog <span style='color:#111;'> 5.38KB </span>","children":null,"spread":false}],"spread":false},{"title":"串口通信.obj <span style='color:#111;'> 48.08KB </span>","children":null,"spread":false},{"title":"串口通信Dlg.obj <span style='color:#111;'> 100.40KB </span>","children":null,"spread":false}],"spread":false},{"title":"ReadMe.txt <span style='color:#111;'> 3.85KB </span>","children":null,"spread":false}],"spread":false}],"spread":true}],"spread":true}]

评论信息

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明