Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Unable to initialize of clear initial buffer or value of richeditcontrol

Unable to initialize of clear initial buffer or value of richeditcontrol

Scheduled Pinned Locked Moved C / C++ / MFC
lounge
5 Posts 2 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    ForNow
    wrote on last edited by
    #1

    I have a richedit control which first time I am not able to clear out to nulls or have no value Below is the code for CGRegs which a modeless Cdialog in which the client area is filled by a rich edit as you can see all the way on the bottom I select the entire richedit and do a Clear The first time around before General Purpose Registers Cdialog/richedit is filled I do a Stream out I would assume the value of cb would be zero but its not its 0x7b for some unexplained reason more so the value of the buffer of the rich edit is

    pbBuff = 0x000001d45061df80 "{\\rtf1\\ansi\\deff0{\\fonttbl{\\f0\\fnil\\fcharset0 Courier New;}}\r\n\\viewkind4\\uc1\\pard\\lang1033\\f0\\fs17

    Dont know what this is when I try to populate the the richedit with the register value it puts after the string

    {\rtf1\ansi\deff0{\fonttbl{\f0\fnil\
    \viewkind4 GPR 00=000000_00000114 GPR 04=00000000_FFFF

    Any one the know who I can clear the inital value of the rich edit thanks

    static DWORD MyStreamOutGPRCallback(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG cb, LONG* pcb)

    BOOL CGPRegs::OnInitDialog()
    {
    gprrichedit = new CRichEditCtrl;
    CDialog::OnInitDialog();
    gprrichedit->SetSel(0, -1);
    gprrichedit->Clear();
    return TRUE;
    }
    CGPRegs::~CGPRegs()
    {
    }

    void CGPRegs::DoDataExchange(CDataExchange* pDX)
    {
    CDialog::DoDataExchange(pDX);
    DDX_Control(pDX, IDC_RICHEDIT22, (CWnd &)*gprrichedit);
    }

    L 1 Reply Last reply
    0
    • F ForNow

      I have a richedit control which first time I am not able to clear out to nulls or have no value Below is the code for CGRegs which a modeless Cdialog in which the client area is filled by a rich edit as you can see all the way on the bottom I select the entire richedit and do a Clear The first time around before General Purpose Registers Cdialog/richedit is filled I do a Stream out I would assume the value of cb would be zero but its not its 0x7b for some unexplained reason more so the value of the buffer of the rich edit is

      pbBuff = 0x000001d45061df80 "{\\rtf1\\ansi\\deff0{\\fonttbl{\\f0\\fnil\\fcharset0 Courier New;}}\r\n\\viewkind4\\uc1\\pard\\lang1033\\f0\\fs17

      Dont know what this is when I try to populate the the richedit with the register value it puts after the string

      {\rtf1\ansi\deff0{\fonttbl{\f0\fnil\
      \viewkind4 GPR 00=000000_00000114 GPR 04=00000000_FFFF

      Any one the know who I can clear the inital value of the rich edit thanks

      static DWORD MyStreamOutGPRCallback(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG cb, LONG* pcb)

      BOOL CGPRegs::OnInitDialog()
      {
      gprrichedit = new CRichEditCtrl;
      CDialog::OnInitDialog();
      gprrichedit->SetSel(0, -1);
      gprrichedit->Clear();
      return TRUE;
      }
      CGPRegs::~CGPRegs()
      {
      }

      void CGPRegs::DoDataExchange(CDataExchange* pDX)
      {
      CDialog::DoDataExchange(pDX);
      DDX_Control(pDX, IDC_RICHEDIT22, (CWnd &)*gprrichedit);
      }

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      gprrichedit = new CRichEditCtrl;
      CDialog::OnInitDialog();
      gprrichedit->SetSel(0, -1);
      gprrichedit->Clear();

      You are creating a new RichEdit control so it will not contain any data, so no need to clear it. As to the other code you show above, I cannot understand what it is about; e.g:

      pbBuff = 0x000001d45061df80 "{\\rtf1\\ansi\\deff0{\\fonttbl{\\f0\\fnil\\fcharset0 Courier New;}}\r\n\\viewkind4\\uc1\\pard\\lang1033\\f0\\fs17

      is not valid, since the parameter is a long integer.

      F 1 Reply Last reply
      0
      • L Lost User

        gprrichedit = new CRichEditCtrl;
        CDialog::OnInitDialog();
        gprrichedit->SetSel(0, -1);
        gprrichedit->Clear();

        You are creating a new RichEdit control so it will not contain any data, so no need to clear it. As to the other code you show above, I cannot understand what it is about; e.g:

        pbBuff = 0x000001d45061df80 "{\\rtf1\\ansi\\deff0{\\fonttbl{\\f0\\fnil\\fcharset0 Courier New;}}\r\n\\viewkind4\\uc1\\pard\\lang1033\\f0\\fs17

        is not valid, since the parameter is a long integer.

        F Offline
        F Offline
        ForNow
        wrote on last edited by
        #3

        That’s the data I find the first time I call streamout with cb being x’7B’ Okay thanks

        L 1 Reply Last reply
        0
        • F ForNow

          That’s the data I find the first time I call streamout with cb being x’7B’ Okay thanks

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          I think that is just the base control data for CRichEdit text, which is used to format it in the display. If you want pure text then you need to use CEdit.

          F 1 Reply Last reply
          0
          • L Lost User

            I think that is just the base control data for CRichEdit text, which is used to format it in the display. If you want pure text then you need to use CEdit.

            F Offline
            F Offline
            ForNow
            wrote on last edited by
            #5

            Thanks

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups