请问visual studio 自带的help workshop是不是HTML help workshop

normalnotebook 2003-08-20 10:02:10
今天我照着书上写帮助的,书上说用visual studio 6.0 自带的HTML help workshop 1.1 ,而我的只有 help workshop,我把他打开一看,与书上的不同,根本没有那几个选择项,请问是不是相同的?

我要制作.chm 不要制作.hlp的

请问有没有好的工具,傻瓜式的操作。
...全文
127 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
weibo79 2003-08-20
  • 打赏
  • 举报
回复
vs6 自带的那个html help workshop就很好用啊,我就是用它来做chm的帮助文档的。
fanfyj 2003-08-20
  • 打赏
  • 举报
回复
不一样,html help workshop制作.chm, Micosofte help workshop制作.hlp(比较老)
去网上搜html help workshop下载一个
normalnotebook 2003-08-20
  • 打赏
  • 举报
回复
我的怎么不是html help workshop ,是Micosofte help workshop啊,这两个是一样的吗?
Visual C# 2005 程序设计自学手册 *****是随书源码光盘***** *****人民邮电出版社***** **长春明日科技组织编写** 本书从初学者角度出发,通过通俗易懂的语言和大量生动典型的实例,由浅入深、循序渐进地介绍使用C#进行WinForms程序开发的常用技术和方法。全书分起步篇、提高篇和实例篇三篇,共21章。起步篇为第1章~第10章,主要介绍认识Visual C#,C#语言基础,C#语句控制,数组、面向对象编程,熟悉WinForms应用程序,WinForms窗体介绍,WinForms应用程序开发常用控件,菜单栏、工具栏和状态栏设计及对话框等内容;提高篇为第11章~第19章,主要介绍使用ADO.NET操作数据库、文件处理技术、HTML帮助文件的制作、GDI+技术、Windows打印控件、网络开发技术、注册表应用、程序调试及Windows应用程序打包与安装等内容;实例篇为第20章~第21章,主要结合实际开发经验介绍利用C#开发企业客户资源管理系统和房屋中介管理系统等内容。   本书附有配套光盘。光盘提供了书中所有实例的源代码,全部源代码都经过精心调试,在Windows XP/Windows 2000/Windows 2003 Server下全部通过,保证能够正常运行。   本书适用于C#初、中级用户,也可作为大、中专院校师生和培训班的教材,对于程序开发爱好者,本书也有非常好的参考价值。 第1篇 起步篇 第1章 认识Visual C# 3 1.1 Visual C# 概述 4 1.1.1 Visual C#发展历程 4 1.1.2 C#语言编程环境 4 1.2 .NET Framework 2.0简介 4 1.2.1 什么是.NET Framework 2.0 4 1.2.2 .NET Framework 2.0特性 5 1.3 安装集成开发环境Microsoft Visual Studio 2005 6 1.3.1 安装Microsoft Visual Studio 2005开发环境 6 1.3.2 安装Microsoft Visual Studio 2005 MSDN帮助 9 1.3.3 如何使用MSDN帮助 11 1.3.4 利用MSDN帮助附带的示例学习编程 12 1.4 创建第一个C# 程序 13 1.4.1 创建项目 13 1.4.2 设计界面 14 1.4.3 编写代码 15 1.4.4 调试运行 16 1.4.5 保存项目 17 1.5 本章小结 17 第2章 C#语言基础 18 2.1 C#语言简介 19 2.2 数据类型 19 2.2.1 什么是数据类型 19 2.2.2 值类型的使用 19 2.2.3 引用类型的使用 19 2.2.4 什么是装箱和拆箱 21 2.2.5 装箱和拆箱的使用 21 2.3 常量与变量 21 2.3.1 声明和使用常量 21 2.3.2 声明变量 22 2.3.3 变量的作用域 23 2.3.4 变量的赋值 23 2.4 数据类型转换 24 2.4.1 隐式类型转换 24 2.4.2 显式类型转换 24 2.5 C#中运算符的使用 25 2.5.1 算术运算符的使用 25 2.5.2 赋值运算符的使用 27 2.5.3 关系运算符的使用 29 2.5.4 逻辑运算符的使用 29 2.5.5 位运算的使用 29 2.5.6 其他特殊运算符 30 2.5.7 运算符优先级 31 2.6 字符串处理 31 2.6.1 比较字符串 32 2.6.2 定位字符及子串 33 2.6.3 格式化字符串 35 2.6.4 截取字符串 35 2.6.5 分割字符串 36 2.6.6 插入和填充字符串 37 2.6.7 删除和剪切字符串 37 2.6.8 复制字符串 39 2.6.9 替换字符串 40 2.6.10 StringBuilder的定义与使用 40 2.6.11 可变字符串类StringBuilder与String的区别 42 2.7 程序编写规范 42 2.7.1 代码书写规则 42 2.7.2 命名规范 43 2.8 注释 44 2.8.1 注释的作用 44 2.8.2 如何使用注释 45 2.9 本章小结 45 第3章 C#语句控制 46 3.1 选择语句 47 3.1.1 使用if语句实现单分支选择结构 47 3.1.2 使用if...else语句实现双分支选择结构 47 3.1.3 使用if...else if...else语句实现多分支选择结构 48 3.1.4 嵌套if语句的使用 50 3.1.5 使用Switch语句实现多分支选择 52 3.2 迭代语句 53 3.2.1 使用while循环语句控制程序 54 3.2.2 使用do while循环语句控制程序 55 3.2.3 使用for循环语句控制程序 56 3.2.4 使用foreach循环语句控制程序 57 3.3 跳转语句 58 3.3.1 使用break语句实现程序跳转 58 3.3.2 使用continue语句的实现程序跳转 60 3.3.3 使用goto语句实现程序跳转 60 3.3.4 使用return语句实现程序跳转 62 3.4 异常处理语句 63 3.4.1 throw语句 63 3.4.2 try-catch语句 64 3.4.3 try-catch-finally语句 65 3.5 本章小结 66 第4章 数组 67 4.1 数组简介 68 4.1.1 数组的概述 68 4.1.2 数组的应用 68 4.2 静态数组 69 4.2.1 一维数组的声明 69 4.2.2 一维数组元素的调用 69 4.2.3 二维数组的声明和调用 70 4.2.4 多维数组 71 4.3 动态数组 72 4.3.1 动态数组的声明 72 4.3.2 声明动态数组的注意事项 74 4.4 数组的基本操作 74 4.4.1 输入与输出数组 74 4.4.2 如何定位数组 76 4.4.3 如何遍历数组 78 4.4.4 增加删除数组元素 78 4.4.5 对数组进行排序 81 4.4.6 数组的合并与拆分 83 4.4.7 数组应用典型实例 85 4.5 本章小结 86 第5章 面向对象编程 87 5.1 面向对象编程 88 5.1.1 什么是面向对象编程 88 5.1.2 面向对象编程语言的特点 88 5.2 类 89 5.2.1 类的概念 89 5.2.2 类的声明 89 5.2.3 类成员的访问 89 5.2.4 类成员的保护 90 5.3 对象 90 5.3.1 对象的声明和实例化 90 5.3.2 类与对象的关系 91 5.4 构造函数和析构函数 91 5.4.1 构造函数的概念及使用 92 5.4.2 析构函数的概念及使用 92 5.5 枚举 93 5.5.1 什么是枚举 93 5.5.2 枚举的定义 93 5.5.3 枚举的使用 94 5.6 方法 95 5.6.1 方法的声明 95 5.6.2 方法的参数 96 5.6.3 静态和非静态方法的使用 96 5.6.4 方法的重载 98 5.7 封装、继承和多态 98 5.7.1 封装的概念及用途 98 5.7.2 封装的使用 98 5.7.3 继承的概念及用途 99 5.7.4 继承的使用 99 5.7.5 多态的概念及用途 100 5.7.6 多态的使用 100 5.8 接口 102 5.8.1 接口的概念 102 5.8.2 声明接口 102 5.8.3 接口的成员 102 5.8.4 接口的实现 103 5.8.5 抽象类与接口 104 5.9 域和属性 105 5.9.1 域的概念及用途 105 5.9.2 域的声明 105 5.9.3 属性的概念及用途 106 5.9.4 属性的声明 106 5.10 泛型 107 5.10.1 泛型概述及优点 107 5.10.2 泛型中的类型参数T 107 5.10.3 泛型的使用 108 5.11 匿名方法 111 5.11.1 什么是匿名方法 111 5.11.2 匿名方法的使用 111 5.12 迭代器 112 5.12.1 什么是迭代器 112 5.12.2 创建迭代器 113 5.12.3 迭代器的使用 113 5.13 分部类 114 5.13.1 什么是分部类 114 5.13.2 定义分部类 114 5.13.3 分部类的使用 114 5.14 事件和索引器 115 5.14.1 事件的概念及用途 115 5.14.2 事件的声明及使用 116 5.14.3 索引器的概念及用途 117 5.14.4 索引器的声明及使用 117 5.15 本章小结 118 第6章 熟悉WinForms应用程序 119 6.1 窗体设计器 120 6.1.1 创建窗体 120 6.1.2 使用窗体设计器 122 6.2 使用工具 123 6.2.1 熟悉工具箱 123 6.2.2 认识控件属性框 125 6.2.3 认识解决方案资源管理器 125 6.2.4 认识服务器资源管理器 128 6.3 本章小结 131 第7章 WinForms窗体介绍 132 7.1 Form窗体 133 7.1.1 Form窗体概述 133 7.1.2 Form窗体的使用 133 7.2 MDI窗体 134 7.2.1 MDI窗体概述 134 7.2.2 MDI窗体的使用 135 7.3 继承窗体 136 7.3.1 继承窗体概述 136 7.3.2 继承窗体的使用 137 7.4 本章小结 138 第8章 WinForms应用程序开发常用控件 139 8.1 控件概述 140 8.1.1 控件的作用 140 8.1.2 控件的属性、方法和事件 140 8.2 控件的分类 142 8.2.1 常用控件 143 8.2.2 容器控件 143 8.2.3 数据控件 143 8.2.4 打印控件 143 8.2.5 对话框控件 144 8.3 控件的相关操作 144 8.3.1 添加控件 144 8.3.2 对齐控件 144 8.3.3 调整控件的前后顺序 144 8.3.4 锁定控件 145 8.3.5 删除控件 145 8.4 文本类控件 145 8.4.1 应用Label控件 145 8.4.2 应用LinkLabel控件 148 8.4.3 应用Button控件 150 8.4.4 应用TextBox控件 153 8.4.5 应用RichTextBox控件 155 8.5 选择类控件 158 8.5.1 应用ComboBox控件 158 8.5.2 应用CheckBox控件 161 8.5.3 应用CheckedListBox控件 163 8.5.4 应用RadioButton控件 166 8.5.5 应用NumericUpDown控件 167 8.5.6 应用ListBox控件 170 8.6 容器控件 173 8.6.1 应用Panel控件 173 8.6.2 应用GroupBox控件 176 8.6.3 应用TabControl控件 177 8.7 组件 180 8.7.1 应用ErrorProvider组件 180 8.7.2 应用Timer组件 182 8.7.3 应用ImageList组件 184 8.7.4 应用FileSystemWatcher组件 186 8.7.5 应用HelpProvider组件 189 8.8 其他常用控件 191 8.8.1 应用ListView控件 191 8.8.2 应用TreeView控件 194 8.8.3 应用PictrueBox控件 197 8.8.4 应用NotifyIcon控件 200 8.8.5 应用DateTimePicker控件 202 8.8.6 应用MonthCalendar控件 204 8.8.7 应用ToolTip控件 206 8.8.8 应用ProgressBar控件 208 8.9 本章小结 211 第9章 菜单栏、工具栏和状态栏设计 212 9.1 菜单栏 213 9.1.1 菜单栏概念和用途 213 9.1.2 菜单栏设计 214 9.2 工具栏 215 9.2.1 工具栏概念和用途 215 9.2.2 工具栏设计 215 9.3 状态栏 217 9.3.1 状态栏概念和用途 217 9.3.2 状态栏设计 217 9.4 本章小结 218 第10章 对话框 219 10.1 消息对话框 220 10.1.1 什么是消息对话框 220 10.1.2 消息对话框的使用 220 10.2 “关于”对话框 228 10.2.1 什么是“关于”对话框 228 10.2.2 “关于”对话框的使用 228 10.3 公共对话框 230 10.3.1 “打开”对话框的使用 230 10.3.2 “另存为”对话框的使用 233 10.3.3 “颜色”对话框的使用 235 10.3.4 “字体”对话框的使用 238 10.3.5 “浏览文件夹”对话框的使用 240 10.4 本章小结 242 第2篇 提高篇 第11章 使用ADO.NET操作数据库 245 11.1 使用ADO.NET访问数据库 246 11.1.1 ADO.NET访问数据库的模式 246 11.1.2 数据库命名空间 247 11.2 ADO.NET对象模型 251 11.2.1 Connection对象 251 11.2.2 Command对象 253 11.2.3 DataReader对象 256 11.2.4 DataSet对象 258 11.2.5 DataAdapter对象 263 11.3 应用DataGridView控件 265 11.3.1 DataGridView控件的属性 265 11.3.2 DataGridView控件的方法 267 11.3.3 DataGridView控件的事件 269 11.3.4 DataGridView控件的使用 271 11.4 数据库开发基本操作 272 11.4.1 向数据库中添加数据 272 11.4.2 修改数据库中数据 273 11.4.3 删除数据库中数据 275 11.4.4 查询数据库中数据 276 11.5 本章小结 278 第12章 文件处理技术 279 12.1 System.IO命名空间 280 12.1.1 File类和Directory类 281 12.1.2 FileInfo类和DirectoryInfo类 283 12.1.3 FileStream类 284 12.1.4 StreamWriter类 287 12.1.5 StreamReader类 289 12.2 文件的基本操作 290 12.2.1 判断文件是否存在 291 12.2.2 创建文件 291 12.2.3 拷贝或移动文件 291 12.2.4 删除文件 291 12.2.5 获取文件基本信息 291 12.3 文件夹的基本操作 292 12.3.1 判断文件夹是否存在 292 12.3.2 创建文件夹 292 12.3.3 移动文件夹 292 12.3.4 删除文件夹 292 12.3.5 遍历文件夹中文件 292 12.4 文件写入和读取 294 12.4.1 文本文件的写入 294 12.4.2 文本文件的读取 294 12.5 解压缩文件 295 12.5.1 使用GZip解压缩文件 295 12.5.2 使用WinRAR解压缩文件 297 12.6 本章小结 299 第13章 HTML帮助文件的制作 300 13.1 HTML帮助文件概述 301 13.2 制作HTML帮助文件 301 13.2.1 安装Microsoft HTML Help Workshop 301 13.2.2 制作HTML帮助主题文件 302 13.2.3 制作HTML帮助项目文件 303 13.2.4 制作目录和目录文件 306 13.2.5 制作关键字和索引文件 309 13.2.6 制作.chm文件 313 13.3 HTML帮助文件的使用 314 13.4 本章小结 315 第14章 GDI+技术 316 14.1 GDI+概述 317 14.2 基本图形绘制 317 14.2.1 绘制直线 317 14.2.2 绘制矩形 318 14.2.3 绘制椭圆 319 14.2.4 绘制圆弧 320 14.2.5 绘制多边形 322 14.2.6 绘制基数样条 323 14.2.7 绘制贝塞尔样条 324 14.2.8 绘制图形路径 326 14.3 GDI+在实际开发中的应用 327 14.3.1 利用柱形图分析每月的商品销售情况 327 14.3.2 利用折线图分析网站访问流量 330 14.3.3 利用饼形图分析公司男女比例 333 14.4 本章小结 334 第15章 Windows打印控件 335 15.1 PrintDocument组件 336 15.1.1 PrintDocument组件的属性 336 15.1.2 PrintDocument组件的方法 337 15.1.3 PrintDocument组件的事件 337 15.1.4 PrintDocument组件的应用 338 15.2 PrintPreviewDialog组件 340 15.2.1 PrintPreviewDialog组件的属性 340 15.2.2 PrintPreviewDialog组件的方法 341 15.2.3 PrintPreviewDialog组件的应用 341 15.3 PrintPreviewControl组件 342 15.3.1 PrintPreviewControl组件的属性 342 15.3.2 PrintPreviewControl组件的方法 344 15.3.3 PrintPreviewControl组件的应用 344 15.4 PrintDialog组件 345 15.4.1 PrintDialog组件的属性 346 15.4.2 PrintDialog组件的方法 347 15.4.3 PrintDialog组件的应用 347 15.5 PageSetupDialog组件 348 15.5.1 PageSetupDialog组件的属性 349 15.5.2 PageSetupDialog组件的方法 349 15.5.3 PageSetupDialog组件的应用 350 15.6 本章小结 351 第16章 网络开发技术 352 16.1 System.Net命名空间 353 16.1.1 Dns类 353 16.1.2 DnsPermission类 355 16.1.3 WebRequest类 356 16.1.4 WebClient类 356 16.2 System.Net.Socket命名空间 356 16.2.1 什么是套接字 357 16.2.2 Socket类的属性、方法 357 16.3 开发网络应用程序 364 16.3.1 开发UDP协议聊天程序 364 16.3.2 开发TCP/IP协议聊天室 365 16.4 电子邮件的发送与接收 367 16.4.1 MailMessage类和SmtpClient类的作用 367 16.4.2 POP3类的作用 368 16.4.3 电子邮件的发送 369 16.4.4 电子邮件的接收 370 16.5 本章小结 375 第17章 注册表应用 376 17.1 注册表基础知识 377 17.1.1 注册表概述 377 17.1.2 注册表的结构 377 17.2 读写注册表 379 17.2.1 读取注册表信息 380 17.2.2 向注册表中写入信息 382 17.3 注册表应用 384 17.3.1 将软件使用次数写入注册表 384 17.3.2 通过注册表优化系统 385 17.4 本章小结 386 第18章 程序调式 388 18.1 什么是断点操作 389 18.2 如何使用开始、中断和停止执行 389 18.3 什么是单步执行 391 18.4 如何运行到指定位置 391 18.5 本章小结 391 第19章 Windows应用程序打包与安装 392 19.1 Windows Installer简介 393 19.2 Windows应用程序部署 393 19.2.1 创建部署项目 393 19.2.2 可选的部署功能 396 19.3 安装及卸载Windows程序 399 19.3.1 在本地计算机上安装 399 19.3.2 部署到其他计算机 399 19.3.3 卸载安装应用序 399 19.4 本章小结 400 第3篇 实例篇 第20章 企业客户资源管理系统 403 20.1 需求分析 404 20.2 系统设计 404 20.2.1 总体规划 404 20.2.2 系统功能结构图 405 20.2.3 开发及运行环境 405 20.3 系统命名规则 405 20.3.1 数据库命名规范 405 20.3.2 程序代码命名规范 406 20.4 数据库设计 407 20.4.1 数据表概要说明 407 20.4.2 主要数据表的结构 408 20.5 系统总体架构 409 20.5.1 文件架构 409 20.5.2 程序文件架构 410 20.6 公共类编写 411 20.6.1 BaseOperate类 411 20.6.2 OperateAndValidate类 413 20.7 系统模块设计 415 20.7.1 系统登录模块设计 415 20.7.2 主窗体模块设计 418 20.7.3 基本信息管理模块设计 420 20.7.4 客户资料管理模块设计 425 20.7.5 联系客户模块设计 431 20.7.6 客户级别分析模块分析 435 20.8 疑难问题解析 436 20.8.1 邮件的发送 436 20.8.2 水晶报表的使用 437 20.9 本章小结 438 第21章 房屋中介管理系统 439 21.1 需求分析 440 21.2 系统设计 440 21.2.1 总体规划 440 21.2.2 系统功能结构图 441 21.2.3 开发及运行环境 441 21.3 系统命名规则 442 21.4 数据库设计 442 21.4.1 数据表概要说明 442 21.4.2 主数据表的结构 442 21.4.3 创建视图 445 21.4.4 创建存储过程 446 21.4.5 创建触发器 448 21.5 系统总体架构 450 21.5.1 文件夹架构 450 21.5.2 文件架构 450 21.6 公共类编写 452 21.6.1 数据库连接类 452 21.6.2 实体类 452 21.6.3 方法类 453 21.7 系统模块设计 454 21.7.1 系统登录模块设计 454 21.7.2 用户信息管理模块设计 456 21.7.3 房源信息设置模块设计 460 21.7.4 房源信息查询模块设计 463 21.7.5 房源状态查询模块设计 467 21.8 疑难问题解析 474 21.8.1 通过触发器对视图进行添加、修改和删除操作 474 21.8.2 结束数据库连接进程完成数据库还原 474 21.9 本章小结 475 光盘源码下载地址: http://download.csdn.net/source/2891837 第一部分(1-8章) http://download.csdn.net/source/2891864 第二部分(9-15章) http://download.csdn.net/source/2891889 第三部分(16-21章) 或者搜索CSDN lawsystem上传资源。 此电子书全部下载地址: http://download.csdn.net/source/2892106 卷1 http://download.csdn.net/source/2892170 卷2 http://download.csdn.net/source/2892205 卷3
1 You Write Software; You have Bugs . . . . . . . . . 1 2 A Systematic Approach to Debugging . . . . . . . 5 2.1 Why Follow a Structured Process? . . . . . . . 5 2.2 Making the Most of Your Opportunities . . . . . . 5 2.3 13 Golden Rules . . . . . . . . . . . . . 7 2.3.1 Understand the Requirements . . . . . . 8 2.3.2 Make it Fail . . . . . . . . . . . . 8 2.3.3 Simplify the Test Case . . . . . . . . . 9 2.3.4 Read the Right Error Message . . . . . . 9 2.3.5 Check the Plug . . . . . . . . . 9 2.3.6 Separate Facts from Interpretation . . . . . 10 2.3.7 Divide and Conquer . . . . . . . . 10 2.3.8 Match the Tool to the Bug . . . . . . . . . 12 2.3.9 One Change at a Time . . . . . . . . . 12 2.3.10 Keep an Audit Trail . . . . . . . . 12 2.3.11 Get a Fresh View . . . . . . . . . . . 13 2.3.12 If You Didn’t Fix it, it Ain’t Fixed . . . . . 13 2.3.13 Cover your Bugfix with a Regression Test . . . . . 13 2.4 Build a Good Toolkit . . . . . . . . . . . . 14 2.4.1 Your Workshop . . . . . . . . . 15 2.4.2 Running Tests Every Day Keeps the Bugs at Bay . . 15 2.5 Know Your Enemy – Meet the Bug Family . . . . . . 17 2.5.1 The Common Bug . . . . . . . . . . 17 2.5.2 Sporadic Bugs . . . . . . . . . . 18 2.5.3 Heisenbugs. . . . . . . . . . 18 2.5.4 Bugs Hiding Behind Bugs . . . . . . . . . 19 2.5.5 Secret Bugs – Debugging and Confidentiality . . . . . 20 2.5.6 Further Reading . . . . . . . . . 21 3 Getting to the Root – Source Code Debuggers . . . . . . 23 3.1 Visualizing Program Behavior . . . . . . . . 23 3.2 Prepare a Simple Predictable Example . . . . . . . 24 3.3 Get the Debugger to Run with Your Program . . . . . . . 24 3.4 Learn to do a Stack Trace on a Program Crash . . . . . . 27 3.5 Learn to Use Breakpoints . . . . . . . . . 28 3.6 Learn to Navigate Through the Program. . . . . . 28 3.7 Learn to Inspect Data: Variables and Expressions . . . . 29 3.8 A Debug Session on a Simple Example . . . . . . 30 4 Fixing Memory Problems . . . . . . . . . . . . 33 4.1 Memory Management in C/C++ – Powerful but Dangerous . . . . 33 4.1.1 Memory Leaks . . . . . . . . . 34 4.1.2 Incorrect Use of Memory Management . . . . 34 4.1.3 Buffer Overruns . . . . . . . . . . . 34 4.1.4 Uninitialized Memory Bugs . . . . . . . . 34 4.2 Memory Debuggers to the Rescue . . . . . . . . 35 4.3 Example 1: Detecting Memory Access Errors . . . . . . . 36 4.3.1 Detecting an Invalid Write Access . . . . . 36 4.3.2 Detecting Uninitialized Memory Reads . . . . 37 4.3.3 Detecting Memory Leaks . . . . . . . 38 4.4 Example 2: Broken Calls to Memory Allocation/Deallocation . . 38 4.5 Combining Memory and Source Code Debuggers . . . . . . 40 4.6 Cutting Down the Noise – Suppressing Errors . . . . . . . 40 4.7 When to Use a Memory Debugger . . . . . . . 41 4.8 Restrictions . . . . . . . . . . . . . . 42 4.8.1 Prepare Test Cases with Good Code Coverage . . . . 42 4.8.2 Provide Additional Computer Resources . . . . . . 42 4.8.3 Multi-Threading May Not be Supported . . . . . . 42 4.8.4 Support for Non-standard Memory Handlers . . . 42 5 Profiling Memory Use . . . . . . . . . . . . 45 5.1 Basic Strategy – The First Steps . . . . . . . . . 45 5.2 Example 1: Allocating Arrays . . . . . . . . 46 5.3 Step 1: Look for Leaks . . . . . . . . . . . 46 5.4 Step 2: Set Your Expectations . . . . . . . . 47 5.5 Step 3: Measure Memory Consumption . . . . . . 47 5.5.1 Use Multiple Inputs . . . . . . . . 48 5.5.2 Stopping the Program at Regular Intervals . . . . . 48 5.5.3 Measuring Memory Consumption with Simple Tools . . 49 5.5.4 Use top . . . . . . . . . . . . 49 5.5.5 Use the Windows Task Manager . . . . . . . 50 5.5.6 Select Relevant Input Values for testmalloc . . . 51 5.5.7 Determine how Memory is Deallocated on Your Machine . 51 5.5.8 Use a Memory Profiler . . . . . . . . . 53 5.6 Step 4: Identifying Greedy Data Structures . . . . . . 54 5.6.1 Instrumenting Data Structures . . . . . . 55 5.7 Putting it Together – The genindex Example. . . . . . 55 5.7.1 Check that There are No Major Leaks . . . . . 56 5.7.2 Estimate the Expected Memory Use . . . . . . . 56 5.7.3 Measure Memory Consumption . . . . . . . 57 5.7.4 Find the Data Structures that Consume Memory . . . 57 6 Solving Performance Problems . . . . . . . . . . 63 6.1 Finding Performance Bugs – A Step-by-Step Approach . . . . . 63 6.1.1 Do an Upfront Analysis . . . . . . . . 64 6.1.2 Use a Simple Method of Measuring Time . . . . . 64 6.1.3 Create a Test Case . . . . . . . . . . 65 6.1.4 Make the Test Case Reproducible . . . . . . 65 6.1.5 Check the Program for Correctness . . . . . . . 66 6.1.6 Make the Test Case Scalable . . . . . . . 66 6.1.7 Isolate the Test Case from Side Effects . . . . 67 6.1.8 Measurement with time can have Errors and Variations . 68 6.1.9 Select a Test Case that Exposes the Runtime Bottleneck . . 68 6.1.10 The Difference Between Algorithm and Implementation . . 70 6.2 Using Profiling Tools . . . . . . . . . . . . 72 6.2.1 Do Not Write Your Own Profiler . . . . . . . 72 6.2.2 How Profilers Work . . . . . . . . 73 6.2.3 Familiarize Yourself with gprof . . . . . . 74 6.2.4 Familiarize Yourself with Quantify . . . . . 79 6.2.5 Familiarize Yourself with Callgrind . . . . . . . 81 6.2.6 Familiarize Yourself with VTune . . . . . . 82 6.3 Analyzing I/O Performance . . . . . . . . . . 84 6.3.1 Do a Sanity Check of Your Measurements . . . . . 85 7 Debugging Parallel Programs . . . . . . . . . 87 7.1 Writing Parallel Programs in C/C++ . . . . . . . . . 87 7.2 Debugging Race Conditions . . . . . . . . . . 88 7.2.1 Using Basic Debugger Capabilities to Find Race Conditions . . . . . . . . . . 89 7.2.2 Using Log Files to Localize Race Conditions . . . . . 91 7.3 Debugging Deadlocks . . . . . . . . . . . . 93 7.3.1 How to Determine What the Current Thread is Executing . 94 7.3.2 Analyzing the Threads of the Program . . . . . 95 7.4 Familiarize Yourself with Threading Analysis Tools . . . . . 96 7.5 Asynchronous Events and Interrupt Handlers . . . . . . . 98 8 Finding Environment and Compiler Problems . . . . . . 101 8.1 Environment Changes – Where Problems Begin . . . . . 101 8.1.1 Environment Variables . . . . . . . . . 101 8.1.2 Local Installation Dependencies . . . . . . . 102 8.1.3 Current Working Directory Dependency . . . . . . 102 8.1.4 Process ID Dependency . . . . . . . . 102 8.2 How else to See what a Program is Doing . . . . . . . 103 8.2.1 Viewing Processes with top . . . . . . . 103 8.2.2 Finding Multiple Processes of an Application with ps . . . 103 8.2.3 Using /proc/ to Access a Process . . . . 104 8.2.4 Use strace to Trace Calls to the OS . . . . . 104 8.3 Compilers and Debuggers have Bugs too . . . . . . . . 106 8.3.1 Compiler Bugs . . . . . . . . . 106 8.3.2 Debugger and Compiler Compatibility Problems . . 107 9 Dealing with Linking Problems . . . . . . . . . . 109 9.1 How a Linker Works . . . . . . . . . . 109 9.2 Building and Linking Objects . . . . . . . . 110 9.3 Resolving Undefined Symbols . . . . . . . . 111 9.3.1 Missing Linker Arguments . . . . . . . . 111 9.3.2 Searching for Missing Symbols . . . . . . . . 112 9.3.3 Linking Order Issues . . . . . . . . . . 113 9.3.4 C++ Symbols and Name Mangling . . . . . 114 9.3.5 Demangling of Symbols . . . . . . . . 115 9.3.6 Linking C and C++ Code . . . . . . . 115 9.4 Symbols with Multiple Definitions . . . . . . . 116 9.5 Symbol Clashes . . . . . . . . . . . 117 9.6 Identifying Compiler and Linker Version Mismatches . . . 118 9.6.1 Mismatching System Libraries . . . . . . . . 119 9.6.2 Mismatching Object Files . . . . . . . . . 119 9.6.3 Runtime Crashes . . . . . . . . . . . 120 9.6.4 Determining the Compiler Version . . . . . 120 9.7 Solving Dynamic Linking Issues . . . . . . . . . 122 9.7.1 Linking or Loading DLLs . . . . . . . . . 122 9.7.2 DLL Not Found . . . . . . . . . 124 9.7.3 Analyzing Loader Issues . . . . . . . 125 9.7.4 Setting Breakpoints in DLLs . . . . . . . 126 9.7.5 Provide Error Messages for DLL Issues . . . . 127 10 Advanced Debugging . . . . . . . . . . . . . 129 10.1 Setting Breakpoints in C++ Functions, Methods, and Operators . 129 10.2 Setting Breakpoints in Templatized Functions and C++ Classes . 131 10.3 Stepping in C++ Methods . . . . . . . . . 133 10.3.1 Stepping into Implicit Functions . . . . . . . 134 10.3.2 Skipping Implicit Functions with the Step-out Command . 135 10.3.3 Skipping Implicit Functions with a Temporary Breakpoint 136 10.3.4 Returning from Implicit Function Calls . . . . 136 10.4 Conditional Breakpoints and Breakpoint Commands . . . . 137 10.5 Debugging Static Constructor/Destructor Problems . . . . . 140 10.5.1 Bugs Due to Order-Dependence of Static Initializers . . 140 10.5.2 Recognizing the Stack Trace of Static Initializers . . 141 10.5.3 Attaching the Debugger Before Static Initialization . . . 142 10.6 Using Watchpoints . . . . . . . . . . . 143 10.7 Catching Signals . . . . . . . . . . . . . 144 10.8 Catching Exceptions . . . . . . . . . . 147 10.9 Reading Stack Traces . . . . . . . . . . . . 148 10.9.1 Stack Trace of Source Code Compiled with Debug Information . . . . . . . . 148 10.9.2 Stack Trace of Source Code Compiled Without Debug Information . . . . . . . . 149 10.9.3 Frames Without Any Debug Information . . . . . . 149 10.9.4 Real-Life Stack Traces . . . . . . . . . 150 10.9.5 Mangled Function Names . . . . . . . . . 151 10.9.6 Broken Stack Traces . . . . . . . . 151 10.9.7 Core Dumps . . . . . . . . . . . . 152 10.10 Manipulating a Running Program . . . . . . . . 153 10.10.1 Changing a Variable . . . . . . . . 156 10.10.2 Calling Functions . . . . . . . . . . 156 10.10.3 Changing the Return Value of a Function . . . . . . 157 10.10.4 Aborting Function Calls . . . . . . . . 157 10.10.5 Skipping or Repeating Individual Statements . . . . . 158 10.10.6 Printing and Modifying Memory Content . . . . . 159 10.11Debugging Without Debug Information . . . . . . 161 10.11.1 Reading Function Arguments From the Stack . . . . . 163 10.11.2 Reading Local/Global Variables, User-Defined Data Types 165 10.11.3 Finding the Approximate Statement in the Source Code . . 165 10.11.4 Stepping Through Assembly Code . . . . . 166 11 Writing Debuggable Code . . . . . . . . . . . . 169 11.1 Why Comments Count . . . . . . . . . . . 169 11.1.1 Comments on Function Signatures . . . . . 170 11.1.2 Comments on Workarounds . . . . . . . . 171 11.1.3 Comments in Case of Doubt . . . . . . . 171 11.2 Adopting a Consistent Programming Style . . . . . . 171 11.2.1 Choose Names Carefully . . . . . . . 171 11.2.2 Avoid Insanely Clever Constructs . . . . . . 172 11.2.3 Spread Out Your Code . . . . . . . . . 172 11.2.4 Use Temporary Variables for Complex Expressions . . . 172 11.3 Avoiding Preprocessor Macros . . . . . . . . . . 173 11.3.1 Use Constants or Enums Instead of Macros . . . . 173 11.3.2 Use Functions Instead of Preprocessor Macros . . . . 175 11.3.3 Debug the Preprocessor Output . . . . . . . . 176 11.3.4 Consider Using More Powerful Preprocessors . . . . 177 11.4 Providing Additional Debugging Functions . . . . . . 179 11.4.1 Displaying User-Defined Data Types . . . . . . 179 11.4.2 Self-Checking Code . . . . . . . . 180 11.4.3 Debug Helpers for Operators . . . . . . . 181 11.5 Prepare for Post-Processing . . . . . . . . . . 181 11.5.1 Generate Log Files . . . . . . . . . 181 12 How Static Checking Can Help . . . . . . . . . . 183 12.1 Using Compilers as Debugging Tools . . . . . . . . 183 12.1.1 Do not Assume Warnings to be Harmless . . . . . 184 12.1.2 Use Multiple Compilers to Check the Code . . . . 186 12.2 Using lint . . . . . . . . . . . . . . 186 12.3 Using Static Analysis Tools . . . . . . . . . . 187 12.3.1 Familiarize Yourself with a Static Checker . . . . 187 12.3.2 Reduce Static Checker Errors to (Almost) Zero . . . 189 12.3.3 Rerun All Test Cases After a Code Cleanup . . . 190 12.4 Beyond Static Analysis . . . . . . . . . . . 190 13 Summary . . . . . . . . . . . . . . 191 A Debugger Commands . . . . . . . . . . . . . 193 B Access to Tools . . . . . . . . . . . . . 195 B.1 IDEs, Compilers, Build Tools . . . . . . . . 195 B.1.1 Microsoft Visual Studio . . . . . . . . 195 B.1.2 Eclipse . . . . . . . . . . . . . 196 B.1.3 GCC . . . . . . . . . . . . 196 B.1.4 GNU Make . . . . . . . . . . . . 196 B.2 Debuggers . . . . . . . . . . . . 196 B.2.1 dbx . . . . . . . . . . . . . 196 B.2.2 DDD . . . . . . . . . . . . 197 B.2.3 GDB . . . . . . . . . . . . 197 B.2.4 ARM RealView . . . . . . . . . 197 B.2.5 TotalView Debugger . . . . . . . . 197 B.2.6 Lauterbach TRACE32 . . . . . . . . . 197 B.3 Environments . . . . . . . . . . . . . 198 B.3.1 Cygwin . . . . . . . . . . . . . 198 B.3.2 VMware . . . . . . . . . . . . 198 B.4 Memory Debuggers . . . . . . . . . . . 198 B.4.1 Purify . . . . . . . . . . . 198 B.4.2 Valgrind . . . . . . . . . . . . 199 B.4.3 KCachegrind . . . . . . . . . . . 199 B.4.4 Insure++ . . . . . . . . . . . . 199 B.4.5 BoundsChecker . . . . . . . . . 200 B.5 Profilers . . . . . . . . . . . . . . 200 B.5.1 gprof . . . . . . . . . . . . 200 B.5.2 Quantify . . . . . . . . . . . . 200 B.5.3 Intel VTune . . . . . . . . . . . . 200 B.5.4 AQtime . . . . . . . . . . . . . 201 B.5.5 mpatrol . . . . . . . . . . . . . 201 B.6 Static Checkers . . . . . . . . . . . 201 B.6.1 Coverity . . . . . . . . . . . . 201 B.6.2 Lint . . . . . . . . . . . . . 201 B.6.3 Splint . . . . . . . . . . . 202 B.6.4 /analyze option in Visual Studio Enterprise Versions . . 202 B.6.5 Klocwork . . . . . . . . . . . 202 B.6.6 Fortify . . . . . . . . . . . . . 202 B.6.7 PC-lint/FlexeLint . . . . . . . . . . 203 B.6.8 QA C++ . . . . . . . . . . . . 203 B.6.9 Codecheck . . . . . . . . . . 203 B.6.10 Axivion Bauhaus Suite . . . . . . . . . 203 B.6.11 C++ SoftBench CodeAdvisor . . . . . . 203 B.6.12 Parasoft C++test . . . . . . . . . . . 204 B.6.13 LDRA tool suite . . . . . . . . . . . 204 B.6.14 Understand C++ . . . . . . . . . . . 204 B.7 Tools for Parallel Programming . . . . . . . . . . 204 B.7.1 Posix Threads . . . . . . . . . . 204 B.7.2 OpenMP . . . . . . . . . . . . 204 B.7.3 Intel TBB . . . . . . . . . . . 205 B.7.4 MPI . . . . . . . . . . . . . 205 B.7.5 MapReduce . . . . . . . . . . . . 205 B.7.6 Intel Threading Analysis Tools . . . . . . . . 205 B.8 Miscellaneous Tools . . . . . . . . . . 206 B.8.1 GNU Binutils . . . . . . . . . . . 206 B.8.2 m4 . . . . . . . . . . . . . . 206 B.8.3 ps . . . . . . . . . . . . . . 206 B.8.4 strace / truss . . . . . . . . . . 207 B.8.5 top. . . . . . . . . . . . . 207 B.8.6 VNC . . . . . . . . . . . . 207 B.8.7 WebEx . . . . . . . . . . . . . 207 C Source Code . . . . . . . . . . . . . . . 209 C.1 testmalloc.c . . . . . . . . . . . . . . 209 C.2 genindex.c . . . . . . . . . . . . 210 C.3 isort.c . . . . . . . . . . . . . 214 C.4 filebug.c . . . . . . . . . . . . . . 216 References . . . . . . . . . . . . . . 217 Index . . . . . . . . . . . . . . . . 219

16,471

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • Web++
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

试试用AI创作助手写篇文章吧