But why is it important to see them and represent them? Your algorithm can still work on the bytes from a file. Sorry I'm not understanding (I have looked at your program). Furthermore why is a certain character set so important? So what if windows wants to display in CP1512 instead of CP437? The bytes are still the same.albert wrote:I need to be able to print all 256 ascii chars so you can open *.exe's in my Vari_Cyph program.
Its for opening *.exe files in the edit box. So you can cypher them.
ASCII 0 to 256 EditControl
Re: ASCII 0 to 256 EditControl
Re: ASCII 0 to 256 EditControl
How do you create a Rich Edit ctrl ?
Maybe a rich edit can display all 256 chars.
Maybe a rich edit can display all 256 chars.
Re: ASCII 0 to 256 EditControl
@Caseih
The regular fonts all have repetitive characters like chr(0) - chr(30) are all the same block chr...and GetWindowText can differentiate between a chr(2) and a chr(7)
If two or more characters are the same as in the ansi fonts , you cant tell what chr it is. So i need to display all 256 chrs and all the chars ned to be different.
The regular fonts all have repetitive characters like chr(0) - chr(30) are all the same block chr...and GetWindowText can differentiate between a chr(2) and a chr(7)
If two or more characters are the same as in the ansi fonts , you cant tell what chr it is. So i need to display all 256 chrs and all the chars ned to be different.
Re: ASCII 0 to 256 EditControl
If you really want to visually represent 256 different byte values so that the user can see that they are different, maybe you should do blocks of colors or patterns to display it more graphically, instead of trying to make an edit control do something it was never designed to do. When it comes to a binary file, typically the only view that makes sense is going to be hex. That's why I mentioned that hex output like
might be as useful as anything.
But as to your problem and questions, I don't know of any way to make things work precisely the way you want, short of writing your own GUI control that will display things exactly as you want.
Code: Select all
0000000: 7f45 4c46 0201 0100 0000 0000 0000 0000 .ELF............
0000010: 0200 3e00 0100 0000 484b 4000 0000 0000 ..>.....HK@.....
0000020: 4000 0000 0000 0000 e8c3 0100 0000 0000 @...............
But as to your problem and questions, I don't know of any way to make things work precisely the way you want, short of writing your own GUI control that will display things exactly as you want.
Re: ASCII 0 to 256 EditControl
The FreeBASIC fonts include the entire character set, and are the VGA pattern. I'm not sure what your display requirements are, but you could render your characters to an appropriate image buffer (ImageCreate), BSAVE the buffer to a bitmap, then display the bitmap in a static control. Forcing the use of the 9x16 font could be a problem.
Re: ASCII 0 to 256 EditControl
Use OEMtoCharBufW to convert OEM (dos) encoding to unicode and then display that.albert wrote:I want to display the 256 characters of the DOS character set.
But edit and rich_edit controls are all unicode by default and use 2 or 4 byte chars.
I want 1 byte chars DOS char(0) to char(255) to display in the edit control..
Can you do it with set font?
Re: ASCII 0 to 256 EditControl
@Marcov
How , and where do you use it ??
Can you give a code snippet to demonstrate it?
How , and where do you use it ??
Can you give a code snippet to demonstrate it?
Re: ASCII 0 to 256 EditControl
See example in my post at http://www.freebasic.net/forum/viewtopi ... 40#p194040fxm wrote:For input/output ("input", "print", "draw string" ...), FreeBasic seems to use DOS/OEM character set (as QuickBasic), but Windows Editor uses Windows/ANSI character set.
As I am French, I use many characters with accents (ascii code > 127).
To convert string OEM/DOS <-> Windows/ANSI
You can use these windows functions (see WIN32.HLP) :
CharToOem
CharToOemBuff
OemToChar
OemToCharBuff
where "Char" corresponds to ANSI Character