Unable to initialize of clear initial buffer or value of richeditcontrol
-
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_FFFFAny 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);
} -
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_FFFFAny 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);
}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.
-
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.
-
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.