News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

RichEdit line scroll issue...

Started by PsYcHoCoDe, September 25, 2012, 05:36:00 PM

Previous topic - Next topic

TouEnMasm


It is said here:http://msdn.microsoft.com/en-us/library/windows/desktop/bb787873(v=vs.85).aspx
Quote
The following table shows which DLL corresponds with which version of Rich ...
However, Riched20.dll is compatible with Windows 95 and may be installed by
I don't see your need for the riched32.dll,perhaps i am blind.Finding a computer with less than win95 seems to me impossible.
Fa is a musical note to play with CL

PsYcHoCoDe

10x, mate, note taken... gonna check it out soon and report some results  :t

PS: ahem, so how should i define these 'new' richedits inside the .rc?!  :icon_eek:

i mean the line with the definition... what should i put instead of "RICHEDIT"? richedit20 or what? :)

jj2007


PsYcHoCoDe

yep RICHEDIT20A works fine... the app's still exposing the same strange behaviour though...  :dazzled:

TouEnMasm

The richedit20 is perfectly stable.There is only one trap in which you can fall.
One or two functions don't put a zero at the end of what they write.
Personnally, i have solved the problem,I don't used them.
After verify and corrected this if necessary,If your problem still exist,it is elsewhere than in the richedit.
Use a debugger to find it.
Fa is a musical note to play with CL

TouEnMasm

Here a dangerous one:
Quote
   INVOKE     SendMessage,Hredit,EM_GETLINE ,lignedebut, addr phrase
remark from the help file:
Quote
Remarks
Edit controls: The copied line does not contain a terminating null character.
used the returned number of char copied to put the zero yourself.


Fa is a musical note to play with CL

hutch--

Psycho,

If and when you want to test the actual rich edit content, you actually select the entire content, write it to a memory buffer THEN write it to disk. If you use the STREAMOUT based method, it changes the line terminator to a CR-LF pair.

Particularly if you are using a richedit 2 or later you need to see what is in the control to be able to select pieces of text and write it to disk. If you directly save a buffer, it DOES NOT alter the line terminator.

As I mentioned from at least Win2000 upwards, richedit 1 is emulated by the later DLL and is not entirely consistent with the earlier Win9x versions, mainly because the later versions also handle UNICODE. Unless you are writing code for Win95OEM, there is little reason to use the earlier version as the emulation is buggy. The later richedit 2/3 performs better, is faster and can do more, just for example multilevel undo/redo but also be warned that if you select this style, its internally different to other styles and makes a mess of the last line's line terminator. This in turn messes up line reporting on the last line which is where an editor is often used while composing text.

If I did not need drag and drop and multilevel undo/redo I would use a normal edit control as they are easier to use and far more consistent.

PsYcHoCoDe

thank you, guys, i'll keep these considerations in mind, when i return to this project  8)

P.S.: @hutch: i don't really need that fancy stuff inside that project...