没有合适的资源?快使用搜索试试~ 我知道了~
首页AAA 计算机相关英文翻译:WinSock 聊天软件 C++
搜索括号里的关键词获得更多的资源: (AAA 计算机相关英文翻译:WinSock 聊天软件 C++) (AAA 文献综述: WinSock 聊天软件 C++ ) (AAA 源代码:基于WinScok的聊天软件的设计与实现 C++) (AAA 毕业论文:基于WinSock的聊天软件的设计与实现 C++)
资源详情
资源评论
资源推荐
*******学院
本科毕业设计(论文)
——英文翻译
题 目 WinSock 和 C++编程语言介绍
学生姓名 ***
专业班级 网络工程******班
学 号 *****
院 (系) 计算机与通信工程学院
指导教师(职称) ****** (讲师)
完成时间 20011 年 5 月 25 日
基于 WinSock 的网络聊天软件的设计与实现 专业班级:网络工程**** 姓名:** 学号:*******
英文原文
WinSock and C + + Programming Language
1 The Windows Programming Model
No matter which development tools you use, programming for Windows is different from
old-style batch-oriented or transaction-oriented programming. To get started, you need to
know some Windows fundamentals. As a frame of reference, we'll use the well-known MS-
DOS programming model. Even if you don't currently program for plain MS-DOS, you're
probably familiar with it.
1.1 Message Processing
When you write an MS-DOS-based application in C, the only absolute requirement is a
function named main. The operating system calls main when the user runs the program, and
from that point on, you can use any programming structure you want. If your program needs
to get user keystrokes or otherwise use operating system services, it calls an appropriate
function, such as getchar, or perhaps uses a character-based windowing library.
When the Windows operating system launches a program, it calls the program's WinMain
function. Somewhere your application must have WinMain, which performs some specific
tasks. Its most important task is creating the application's main window, which must have its
own code to process messages that Windows sends it. An essential difference between a
program written for MS-DOS and a program written for Windows is that an MS-DOS-based
program calls the operating system to get user input, but a Windows-based program processes
user input via messages from the operating system.
Note: Many development environments for Windows, including Microsoft Visual C++
version 6.0 with the Microsoft Foundation Class (MFC) Library version 6.0, simplify
programming by hiding the WinMain function and structuring the message-handling process.
When you use the MFC library, you need not write a WinMain function but it is essential that
you understand the link between the operating system and your programs.
1
基于 WinSock 的网络聊天软件的设计与实现 专业班级:网络工程**** 姓名:** 学号:*******
Most messages in Windows are strictly defined and apply to all programs. For example, a
WM_CREATE message is sent when a window is being created, a WM_LBUTTONDOWN
message is sent when the user presses the left mouse button, a WM_CHAR message is sent
when the user types a character, and a WM_CLOSE message is sent when the user closes a
window. All messages have two 32-bit parameters that convey information such as cursor
coordinates, key code, and so forth. Windows sends WM_COMMAND messages to the
appropriate window in response to user menu choices, dialog button clicks, and so on.
Command message parameters vary depending on the window's menu layout. You can define
your own messages, which your program can send to any window on the desktop. These user-
defined messages actually make C++ look a little like Smalltalk.
Don't worry yet about how these messages are connected to your code. That's the job of the
application framework. Be aware, though, that the Windows message processing requirement
imposes a lot of structure on your program. Don't try to force your Windows programs to look
like your old MS-DOS programs. Study the examples in this book, and then be prepared to
start fresh.
1.2 The Windows Graphics Device Interface
Many MS-DOS programs wrote directly to the video memory and the printer port. The
disadvantage of this technique was the need to supply driver software for every video board
and every printer model. Windows introduced a layer of abstraction called the Graphics
Device Interface (GDI). Windows provides the video and printer drivers, so your program
doesn't need to know the type of video board and printer attached to the system. Instead of
addressing the hardware, your program calls GDI functions that reference a data structure
called a device context. Windows maps the device context structure to a physical device and
issues the appropriate input/output instructions. The GDI is almost as fast as direct video
access, and it allows different applications written for Windows to share the display.
1.3 Resource-Based Programming
To do data-driven programming in MS-DOS, you must either code the data as initialization
constants or provide separate data files for your program to read. When you program for
Windows, you store data in a resource file using a number of established formats. The linker
2
剩余12页未读,继续阅读
gaufon
- 粉丝: 0
- 资源: 4
上传资源 快速赚钱
- 我的内容管理 收起
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
会员权益专享
最新资源
- zigbee-cluster-library-specification
- JSBSim Reference Manual
- c++校园超市商品信息管理系统课程设计说明书(含源代码) (2).pdf
- 建筑供配电系统相关课件.pptx
- 企业管理规章制度及管理模式.doc
- vb打开摄像头.doc
- 云计算-可信计算中认证协议改进方案.pdf
- [详细完整版]单片机编程4.ppt
- c语言常用算法.pdf
- c++经典程序代码大全.pdf
- 单片机数字时钟资料.doc
- 11项目管理前沿1.0.pptx
- 基于ssm的“魅力”繁峙宣传网站的设计与实现论文.doc
- 智慧交通综合解决方案.pptx
- 建筑防潮设计-PowerPointPresentati.pptx
- SPC统计过程控制程序.pptx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论2