Font Size: a A A

The Implementation Of Clipboard Based On Rich Text Format

Posted on:2005-11-20Degree:MasterType:Thesis
Country:ChinaCandidate:W TongFull Text:PDF
GTID:2168360125950337Subject:Computer application technology
Abstract/Summary:PDF Full Text Request
The Rich Text Format (RTF) Specification developed by Microsoft is a method of encoding formatted text and graphics for easy transfer between applications on different operating systems. RTF files created in Word 6.0 (and later) for Windows have a file type of ".RTF". Currently, the Rich Text Format has already been such a sort of widely used file structures that many word-processing editors support it, and, what's more, software-developing tools such as VB provide RichTextBox control.Clipboard is an extremely useful tool that helps applications exchange data statically. Actually, it is not a self-governed application, but a block of memory allocated separately and in advance under Windows and a temporary region used for storing data transmitted between applications. Windows offers us functions called Application Programming Interface (API) to assist applications in manipulating clipboard.The expression ability of RTF is equal to that of .doc known as a kind of Word file formats. However, the Rich Text Format possesses more advantages. Firstly, it is more feasible to program RTF, for RTF is an ASCII-encoding mode and the content is readable. Secondly, RTF is almost free from change and it is easy for us to trace its variations. Finally, RTF is prior in the aspect of security for it is unlikely infected by viruses. All above are shortcomings of the binary-encoding mode .doc.It is as a result of these obvious merits and its popularity that those programmers who write all-propose tools should consider to add the function of inputting and outputting RTF files to their own works. As an instance of reading and writing RTF files, this paper is concerned with the data transfer between RTF files and clipboard.To establish a clipboard based on RTF is to build a "bridge" between RTF files and clipboard. According to the "groundwork" of the bridge, we can divide the transfer methods into two classes: "direct means", which analyze RTF and reconstruct the formatted objects, and "indirect means", which utilize the API functions existed in Windows.This article systemically introduce the conception of RTF and clipboard, and then discuss the application using Microsoft Foundation Class(MFC) and Component Object Model(COM) in establishing a clipboard based on RTF under the developing environment of MS Visual C++. This paper mainly includes works on four subjects:1 Rich Text FormatAlthough the structure of RTF is not sophisticated, the content of RTF is various. By the means of reading keywords and comprehending their effection, this paper categorizes them by syntax function and describes a part of RTF, which should be chiefly noticed, using the formal syntax based on Backus-Naur Form. The formal syntax has a great help in building a RTF analyzer and constructor and the expansibility of the program.2 ClipboardFor seeing deeper into the contents of the clipboard, this article provides a utility that deals with HDROP data on the clipboard. It is an especially attractive clipboard viewer and an important part of the ultimate analyzer and constructor. It can also acquaint us with the data in a drag-and-drop operation.3 indirect means to establish a RTF analyzer and constructorThis paper implements four indirect ways to found the data exchanging paths between RTF and Clipboard.The first means is based on Visual C++ MFC Application Frame. The essence of this method is to harness the characters furnished by MFC Application Frame, including the support of data transfer between RTF and View and that between View and Clipboard.The second means is based on the class CRichEditView in Visual C++ MFC. The essence of this method is to use the class CRichEditView, which encapsulate the class CRichEditCtrl, to manipulate the RTF stream.The third means is based on the OLE automation client. The essence of this method is to make use of COM to call the API functions of Word in order to navigate RTF files.The fourth means is based on embedding Word into the view. The essence of this method is to employ COM to inlay...
Keywords/Search Tags:Implementation
PDF Full Text Request
Related items