如何在RichEdit2可视化c中显示所有ASCII字符++
我想显示所有 ascii 字符(http://msdn.microsoft.com/en-us /library/Aa245273) 在 Visual C++ 的 richEdit2 控件中包括 NULL 但我不知道如何?
所以请帮帮我,我该怎么做?
实际上我可以显示所有字符,但是当从 richedit 框中找到 ASCII NUL 时,不会显示任何其他字符,并且我想显示所有字符,下面给出了我的代码,请帮助我,
下面给出了我的代码
void CclientCheckDlg::ReadFileData()
{
char *readfilename= configfilepath ;
//FILE *fp=fopen(readfilename ,"r");
std::ifstream openFile(readfilename,std::ios::out | std::ios::binary);
//string s;
unsigned char c;
//std::string s;
int i=0;
do
{
c=openFile.get();
if(c==EOF||i==999)
break;
unsignedCharPointer[i]=c;
i++;
printf("%c",c);
}while(!openFile.eof());
//fclose(fp);
CString cs(unsignedCharPointer);
OutputDebugString(cs);
// configArrStr=s.c_str();
int begin=m_rich_edit.GetTextLength();
m_rich_edit.SetSel(begin,begin);
// CA2CT ct(unsignedCharPointer);
lpctstr=(LPCTSTR)unsignedCharPointer;
OutputDebugString(lpctstr);
m_rich_edit.ReplaceSel(cs);
}
,所以请任何人都可以帮助我,如何显示空字符?
I want to display all ascii characters(http://msdn.microsoft.com/en-us/library/Aa245273) including NULL in richEdit2 control of visual c++ but i don't know how?
so please help help me how can i do this?
Actually i can show all character but when ASCII NUL is found from that richedit box doesn't show any further character and i want to display all character my code is given below please help me
my code is given below
void CclientCheckDlg::ReadFileData()
{
char *readfilename= configfilepath ;
//FILE *fp=fopen(readfilename ,"r");
std::ifstream openFile(readfilename,std::ios::out | std::ios::binary);
//string s;
unsigned char c;
//std::string s;
int i=0;
do
{
c=openFile.get();
if(c==EOF||i==999)
break;
unsignedCharPointer[i]=c;
i++;
printf("%c",c);
}while(!openFile.eof());
//fclose(fp);
CString cs(unsignedCharPointer);
OutputDebugString(cs);
// configArrStr=s.c_str();
int begin=m_rich_edit.GetTextLength();
m_rich_edit.SetSel(begin,begin);
// CA2CT ct(unsignedCharPointer);
lpctstr=(LPCTSTR)unsignedCharPointer;
OutputDebugString(lpctstr);
m_rich_edit.ReplaceSel(cs);
}
so please can anyone help me,how can i display null character?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
谢谢大家。
Thank you all.