Translation <> ---- Very simple! Have a try!

zhangcrony 2004-07-05 04:02:18
What is this about? I think you know why.
It's a segment from one of Jeff Prosise's famous books. Someone may get a Chinese version on hand at present.
Please don't use any dictionaries and don't refer to any other translation by somebody else. Just DO IT YOURSELF!

______________________________________________________________________

MFC is the C++ class library Microsoft provides to place an object-oriented wrapper around the Windows API. Version 6 contains about 200 classes, some of which you'll use directly and others of which will serve primarily as base classes for classes of your own. Some MFC classes are exceedingly simple, such as the CPoint class that represents a point (a location defined by x and y coordinates). Others are more complex, such as the CWnd class that encapsulates the functionality of a window. In an MFC program, you don't often call the Windows API directly. Instead, you create objects from MFC classes and call member functions belonging to those objects. Many of the hundreds of member functions defined in the class library are thin wrappers around the Windows API and even have the same names as the corresponding API functions. An obvious benefit of this naming convention is that it speeds the transition for C programmers making the move to MFC. Want to move a window? A C programmer would probably call the SetWindowPos API function. Look up SetWindowPos in an MFC reference, and you'll find that MFC supports SetWindowPos, too. It's a member of the CWnd class, which makes sense when you think of a window as an object and SetWindowPos as an operation you might want to perform on that object.

MFC is also an application framework. More than merely a collection of classes, MFC helps define the structure of an application and handles many routine chores on the application's behalf. Starting with CWinApp, the class that represents the application itself, MFC encapsulates virtually every aspect of a program's operation. The framework supplies the WinMain function, and WinMain in turn calls the application object's member functions to make the program go. One of the CWinApp member functions called by WinMain—Run—provides the message loop that pumps messages to the application's window. The framework also provides abstractions that go above and beyond what the Windows API has to offer. For example, MFC's document/view architecture builds a powerful infrastructure on top of the API that separates a program's data from graphical representations, or views, of that data. Such abstractions are totally foreign to the API and don't exist outside the framework of MFC or a similar class library.
...全文
162 15 打赏 收藏 转发到动态 举报
写回复
用AI写文章
15 条回复
切换为时间正序
请发表友善的回复…
发表回复
pomelowu 2004-07-15
  • 打赏
  • 举报
回复
good指什么?
zhangcrony 2004-07-15
  • 打赏
  • 举报
回复
Good
sohou 2004-07-05
  • 打赏
  • 举报
回复
让我来翻译吧,这几天没时间,过2天怎么样
pomelowu 2004-07-05
  • 打赏
  • 举报
回复
加了几天班,进度提前,我也来试试

C++ classes have member functions; COM objects have methods. Methods are grouped into interfaces and are called through interface pointers. Interfaces exist to semantically bind together groups of related methods. For example, suppose you're writing a COM class that has methods named Add, Subtract, and CheckSpelling. Rather than make all three methods members of the same interface, you might assign Add and Subtract to an interface named IMath and CheckSpelling to an interface named ISpelling. (Prefacing interface names with a capital I for Interface is an almost universal COM programming convention.) Microsoft has predefined more than 100 interfaces that any COM object can support. These interfaces are called standard interfaces. User-defined interfaces such as IMath and ISpelling are custom interfaces. COM objects can use standard interfaces, custom interfaces, or a combination of the two.

C++类有成员函数,COM对象有方法。方法按接口归类,并通过接口指针调用。接口从语义上把相关的方法分组。比如,你正在写一个有Add、Subtract和CheckSpelling方法的COM类。你应该把Add和Subtract分配到IMath接口,把CheckSpelling分配到ISpelling接口;而不是把这三个方法都分配到一个接口。(以大写的I作为接口名的首字母已经是COM编程的统一习惯)微软已经预先定义了超过100种任意COM对象都支持的接口,他们被称为标准接口。象IMath和ISpelling这样的称为用户自定义接口。COM对象能够使用标准接口、用户自定义接口以及把这两者结合起来使用。
Kudeet 2004-07-05
  • 打赏
  • 举报
回复
COM is an acronym for Component Object Model. Simply put, COM is a way of building objects that is independent of any programming language. If you want the gory details, you can download the COM specification from Microsoft's Web site.

COM 是Component Object Model的缩写,简单的说,COM是一种独立于任何程序语言的建立对象的方法。如果你想了解更精彩的细节部分,可以到微软站点下载COM的详细说明。
Kudeet 2004-07-05
  • 打赏
  • 举报
回复
继续啊
MFC也是一个应用程序的框架。不止是一个简单的类的集合,MFC帮助定义程序的结构同时也处理一些关于应用程序运行的烦琐事务。程序以CWinApp开始,它代表了一个应用程序,MFC虚拟继承了程序操作的每个方面。这个框架也支持WinMain函数,而WinMain真正调用的是应用程序对象的成员函数使程序运行。CWinApp的成员函数Run就被WinMain调用来通过消息循环把消息传递给程序的窗口。MFC也是对WINDOWS API的抽象,还远远的超过了WINDOWS API所提供的函数。例如,MFC在API基础上建立了强大的文档/视图结构,它把程序的数据从图形表示或视图分离出来。而这些数据与API是没有任何关系的,也不存在于MFC的框架和类似的类库里。
PiggyXP 2004-07-05
  • 打赏
  • 举报
回复
太多了呵呵,随便挑一段翻译吧^_^

C++ programmers are accustomed to writing classes that other C++ programmers can use. The problem with these classes is that only other C++ programmers can use them. COM tells us how to build objects in any programming language that can also be used in any programming language. In other words, COM transcends language-specific ways of building reusable objects and gives us a true binary standard for object architectures.

C++程序员习惯于写其他程序员也可通用的类.但是问题在于这些类只有其他的C++程序员才能使用它们.
但是COM就告诉我们了如何构造一种与语言无关的其他编程语言都可以使用的对象.换言之,COM超越了使用特定语言构造可充用对象的的方法,给我们的对象架构提供了一个真实的二进制标准.
快乐鹦鹉 2004-07-05
  • 打赏
  • 举报
回复
MFC是微软提供的用面向对象的方法包装了Windows API的C++运行库。6.0版本中包含有大约200个类。有些类你可以直接使用,还有些类你必须作为基类派生自己的子类。有些MFC类非常简单,例如CPoint类只是描绘了一个点(用x和y定义的一个位置),其他类就比较复杂了,比如CWnd类,封装了一个窗口的所有功能。在MFC程序中,你不必直接调用Windows API函数,你只需用MFC类创建对象,然后调用这个类的成员函数。
未完待续!!!
Kudeet 2004-07-05
  • 打赏
  • 举报
回复
先来点!知道zhangcrony的英语水平.....呵呵,不要打击我啊!
MFC是微软提供的一种面向对象的对WINDOWS API函数封装的C++类库。在MFC 6.0中大约有200个类,一些是我们经常直接使用的类,其他的主要用于我们自定义类的基类。一些MFC类是非常简单的,比如CPoint类,它就是代表了一个点(一个用X,Y确定的交叉位置)。其他类就要复杂些,如CWnd类就囊括了一个窗口函数的作用。在MFC程序里,一般很少直接调用WINDOWS API函数,相反的,我们自己创建对象从MFC类同时调用属于这个类的一些成员函数。在MFC类库里定义了几百个函数,基本上包含了WINDOWS API函数,而且部分函数的名字与API函数的名字也是一样的。这样命名的最大好处就是能够让C程序员很快的转移到MFC中来。如果想移动一个窗口,C程序员可能会调用API的SetWindowPos函数,同样你在MFC参考手册里查SetWindowPos就会发现MFC也支持SetWindowPos,它是CWnd类的一个成员函数,在你把窗口当作一个对象,SetWindowPos当作是在这个对象上的一个操作的时候是很非常有意义的。
快乐鹦鹉 2004-07-05
  • 打赏
  • 举报
回复
你是不会,还是要考我们啊?
zhangcrony 2004-07-05
  • 打赏
  • 举报
回复
鹦鹉不要只灌水呀~_~
快乐鹦鹉 2004-07-05
  • 打赏
  • 举报
回复
还有啊???
zhangcrony 2004-07-05
  • 打赏
  • 举报
回复
About COM
-------------------------------------------------------------------------
COM is an acronym for Component Object Model. Simply put, COM is a way of building objects that is independent of any programming language. If you want the gory details, you can download the COM specification from Microsoft's Web site. But don't be too quick to pull out your browser: if this is your first exposure to COM, the specification might be a bit overwhelming. A better approach is to start slowly and allow yourself time to understand the big picture rather than risk getting mired in details that for the moment are unimportant.

C++ programmers are accustomed to writing classes that other C++ programmers can use. The problem with these classes is that only other C++ programmers can use them. COM tells us how to build objects in any programming language that can also be used in any programming language. In other words, COM transcends language-specific ways of building reusable objects and gives us a true binary standard for object architectures.

C++ classes have member functions; COM objects have methods. Methods are grouped into interfaces and are called through interface pointers. Interfaces exist to semantically bind together groups of related methods. For example, suppose you're writing a COM class that has methods named Add, Subtract, and CheckSpelling. Rather than make all three methods members of the same interface, you might assign Add and Subtract to an interface named IMath and CheckSpelling to an interface named ISpelling. (Prefacing interface names with a capital I for Interface is an almost universal COM programming convention.) Microsoft has predefined more than 100 interfaces that any COM object can support. These interfaces are called standard interfaces. User-defined interfaces such as IMath and ISpelling are custom interfaces. COM objects can use standard interfaces, custom interfaces, or a combination of the two.
快乐鹦鹉 2004-07-05
  • 打赏
  • 举报
回复
嗯。还能看懂
快乐鹦鹉 2004-07-05
  • 打赏
  • 举报
回复
太长了啊

16,472

社区成员

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

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

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