Pelles C forum

C language => Tips & tricks => Topic started by: TimoVJL on July 05, 2013, 06:31:23 PM

Title: RichEdit OLE callback demo
Post by: TimoVJL on July 05, 2013, 06:31:23 PM
Here is simple richedit test with OLE callback for showing pictures too.
Please inform if you find errors.

EDIT: fix pointer passing
Title: Re: RichEdit OLE callback demo
Post by: czerny on July 05, 2013, 08:19:02 PM
Don't know if it is a bug or a feature, that a RETURN inserts a new row.
Title: Re: RichEdit OLE callback demo
Post by: TimoVJL on July 05, 2013, 08:44:06 PM
That's richedit feature.
There is still bug in pointer passing too.
Title: Re: RichEdit OLE callback demo
Post by: jj2007 on July 06, 2013, 12:19:52 AM
Crashes on exit at 0x74dcc3a8 (Win XP SP3).
The instruction is call [ecx+8], and ecx=0.
Program terminates normally when the call [ecx+8] is disabled (but attention, there is a push eax before).

Otherwise a great demo - thumbs up 8)
Title: Re: RichEdit OLE callback demo
Post by: TimoVJL on July 06, 2013, 10:08:42 AM
least missing DestroyWindow(hEdit) at exit before FreeLibrary()
Title: Re: RichEdit OLE callback demo
Post by: czerny on July 06, 2013, 08:13:46 PM
That's richedit feature.
How to enter a line break than?
Title: Re: RichEdit OLE callback demo
Post by: jj2007 on July 07, 2013, 12:20:46 AM
Return inserts a paragraph (aka CrLf or \par in RTF speak),
Shift Return inserts a line break (\line in RTF).

However, you can see it only when you save as RTF and then reopen in a plain text editor like Notepad.
Title: Re: RichEdit OLE callback demo
Post by: czerny on July 07, 2013, 11:43:03 AM
Return inserts a paragraph (aka CrLf or \par in RTF speak),
Shift Return inserts a line break (\line in RTF).
That's what I mean: Return should insert a line break (\par in RTF speak) but it inserts a new row.
Title: Re: RichEdit OLE callback demo
Post by: TimoVJL on July 07, 2013, 11:50:45 AM
Return inserts a paragraph (aka CrLf or \par in RTF speak),
Shift Return inserts a line break (\line in RTF).
That's what I mean: Return should insert a line break (\par in RTF speak) but it inserts a new row.
here is small test program to show rtf code too.
BTW: inside table it insert new table row and outside just new line
Title: Re: RichEdit OLE callback demo
Post by: TheRaven on June 09, 2017, 05:34:25 AM
Technically, the rich edit control should just advance to the next line then if a character key is pressed then /par else if enter is pressed again /line. The rich edit control is poorly designed not buggy just like the text edit control for notepad has odd behaviors when strings contain certain chars like $.

That's my two non-cents ;-)

Good stuff though and good feedback.