Solved

RichEdit control

Posted on 1998-07-09
2
407 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 50 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
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…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

705 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