?
Solved

RichEdit control

Posted on 1998-07-09
2
Medium Priority
?
409 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

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

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

This article shows a few slightly more advanced techniques for Windows 7 gadget programming, including how to save and restore user settings for your gadget and how to populate the "details" panel that is displayed in the Windows 7 gadget gallery.  …
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
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…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

765 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