Unit OLERichEdit

+++++++++++++++ TCRYPTEDIT +++++++++++++++++++++++++++++++ I've found a lot of usefull Delphi-Freeware in the Internet. So I want to return some code to the Internet... TCryptedit is a OLERichedit that encrypts data on SaveToFile and decrypts data on Loadfromfile - depends of the fileextension. AUTOR: Joe Blocher DATE: Jan. 98 WARRANTY: No warranty, promise, or guarantee -> try yourself STATUS: Freeware for Delphi 3 1) First you have to register the Fileextensions and the encryption-keys, for example in the OnCreate-Event: procedure TForm1.FormCreate(Sender: TObject); begin Cryptedit1.RegisterExt('xyz',12345,6789,2468); Cryptedit1.RegisterExt('abc',23456,3456,7890); ... end; Use these registered extensions in the Opendialog-Filter. Not registered extensions like (*.txt, *.rtf ...) or registered with 0 (like: RegisterExt('rtf',0,0,0)) will not be supported by encryption. 2) Don't forget to use the method Cryptedit1.SaveToFile instead of Cryptedit1.lines.SaveToFile (same for Loadfromfile), when you store and load data!! I know, that the XOR-Encryption I used (Code from Borland-Homepage) is not very secure, but it's fast. You have to change then ConvertWriteStream and ConvertReadStream - methods from TCryptConvert when you want to use another algorithm. ***************** TOLERICHEDIT ***************************************** I found TOLERICHEDIT in Newsgroups and I was really happy!!!!!!!! Here the text: Subject: TRichEdit and Graphics -- SOLVED!! From: "Greg Chapman" Date: 1997/10/29 Message-ID: <638r29$n0b9@forums.borland.com> Newsgroups: borland.public.delphi.vcl.components.using Using Delphi 3 and the RichEdit control which comes with the IE 4 release, it appears that all you absolutely have to do to display graphics and other embedded or linked objects in a RichEdit control is implement one method of IRichEditOLECallback: specifically GetNewStorage. I've attached a TRichEdit descendent which does this (in the file OLERichEdit.pas) as well as a translation of the richole.h file (from BC5) which defines the RichEdit OLE interfaces. The OLERichEdit file also includes one obvious enhancement to the default behavior. If you enable the VerbMenu define, then when you select a (linked or embedded) object and right click on it, the control will pop up a menu of available verbs for the object. The code used is essentially the same as that in the VCL's TOleContainer. The implementation of the control included here allows you to edit objects by double clicking on them; it opens whatever application is registered to edit the object type (e.g., double click on a bitmap and Paint opens up). The RichEdit control will also support in-place activation, provided you implement the right methods of IRichEditOleCallback (I did not try this in the unit included here). It appears to me that alot of the stuff in OLECTNRS.PAS could be used to enable this behavior. Finally, a warning. This control has not been extensively tested by any means, and there may well be bugs or gotchas that I have not anticipated. Use with caution. It is intended primarily as a starting point for people interested in extending TRichEdit. Version 0.01: I added code to explicitly close OLE objects when they are deleted or when the rich edit control is closed or cleared. It is not clear to me whether this is necessary: Microsoft's C-based REITP sample (which demonstrates the RichEdit COM interfaces) never calls IOleObject.Close, which implies that the RichEdit control handles closing the objects itself. On the other hand, MFC 4.1 wraps each IOleObject in a C++ class called CRichEditCntrItem. This class descends from COleClientItem, which always calls IOleObject.Close before releasing its IOleObject reference. The upshot is that MFC will call IOleObject.Close for each object in the RichEdit control when it is done with the object. So now TOleEdit does the same thing. Note that if the control is enhanced to support in-place activation, a call to IRichEdit.InPlaceDeactivate should be made before closing the objects.

Classes

TCryptEdit -
TCryptKeys -
TOLEEdit -

Functions

Register - Keepwindowsalive; For large files!!!

Types

Constants

Variables


Functions


procedure Register;

Keepwindowsalive; For large files!!!

Types


Constants


Variables