?
Solved

RichEdit control

Posted on 1998-07-09
2
Medium Priority
?
412 Views
Last Modified: 2013-12-03
How to use the RichEdit control in C
(Sample code will be appreciated) ?
0
Comment
Question by:ct_consultant
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 7

Accepted Solution

by:
BlackMan earned 150 total points
ID: 1409822
Here is something i got from a newsgroup a while ago..

void __fastcall TRichEditPlus::CreateParams(Controls::TCreateParams&Params){
      const char RichEditModuleName[] = "RICHED20.DLL";      long int OldError;
      OldError = SetErrorMode(SEM_NOOPENFILEERRORBOX);
      FLibHandle = (int) LoadLibrary(RichEditModuleName);
      if (FLibHandle < HINSTANCE_ERROR) FLibHandle = 0;      SetErrorMode(OldError);
//      TRichEdit::CreateParams(Params);      TCustomMemo::CreateParams(Params);
//      CreateSubClass(Params, "RICHEDIT");      CreateSubClass(Params, RICHEDIT_CLASS);
      Params.Style = Params.Style |            (HideScrollBars ? 0 : ES_DISABLENOSCROLL) |
            (HideSelection ? 0 : ES_NOHIDESEL);}
//---------------------------------------------------------------------------
// free the library on destroy (actually, it will not unload until last
// TRichEditPlus instance is destroyed)//
void __fastcall TRichEditPlus::DestroyWnd(void){      if (FRichEditOle) {
            delete FRichEditOle;            FRichEditOle = 0;            }      TRichEdit::DestroyWnd();
      if (FLibHandle != 0) FreeLibrary((void*) FLibHandle);}
//---------------------------------------------------------------------------
bool __fastcall TRichEditPlus::GetCanUndo(void){
      return ::SendMessage(Handle, EM_CANUNDO, 0, 0);}
//---------------------------------------------------------------------------
bool __fastcall TRichEditPlus::GetCanRedo(void){
      return ::SendMessage(Handle, EM_CANREDO, 0, 0);}
//---------------------------------------------------------------------------
bool TRichEditPlus::Undo(void){      // returns zero on failure
      return ::SendMessage(Handle, EM_UNDO, 0, 0);}
//---------------------------------------------------------------------------
bool TRichEditPlus::Redo(void){      // returns zero on failure
      return ::SendMessage(Handle, EM_REDO, 0, 0);}
//---------------------------------------------------------------------------
void __fastcall TRichEditPlus::SetUndoLimit(int limit){
      // returns number actually set -- may be smaller than request
      FUndoLimit = ::SendMessage(Handle, EM_SETUNDOLIMIT, limit, 0);}
//---------------------------------------------------------------------------
void TRichEditPlus::StopGroupTyping(void){
      // forces new group for undo -- cannot fail
      ::SendMessage(Handle, EM_STOPGROUPTYPING, 0, 0);}
//---------------------------------------------------------------------------
// build a string of text representing the nature of the next undo/redo//
static const char *UndoNames[] = {
      "Cannot ", " Typing", " Delete", " Drop Object", " Cut", " Paste"      };
0
 
LVL 7

Expert Comment

by:BlackMan
ID: 1409823
Oops, my cut&paste screwed the formatting - sorry! I hope you can read it, otherwise just reject it..
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to make a Windows 7 gadget that accepts files dropped from the Windows Explorer.  It also illustrates how to give your gadget a non-rectangular shape and how to add some nifty visual effects to text displayed in a your gadget.…
This article describes how to programmatically preset the "Pages per Sheet" option that's available with most printer drivers.   This setting lets you do "n-Up" printing, where two, four, or more pages are printed on each sheet of paper. If your …
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question