Page 1 of 1

Working with both TRichViewEdit and TDBRichViewEdit

Posted: Wed Aug 02, 2006 8:47 pm
by jorec
Hello,


I did a function that pass as parameter a 'TRichViewEdit' and do some processing on it. It is working ok but how can I use the same function but passing a 'TDBRichViewEdit' as parameter? Typecasting doesn´t work. Is there some way?

Thanks for any help.

Posted: Wed Aug 02, 2006 11:23 pm
by Michel
I think, if you could change your function to accept the common ancestor of both classes (TCustomRichViewEdit) as parameter, you could pass either of them to it.

Michel

Posted: Thu Aug 03, 2006 10:13 am
by Sergey Tkachenko
Yes, use their common ancestor - TCustomRichViewEdit.

Class hierarchy:

Code: Select all

TCustomRichView
| | |
| | TRichView
| |
|  TDBRichView
|
TCustomRichViewEdit
| |
| TRichViewEdit
|
TDBRichViewEdit

Posted: Thu Aug 03, 2006 6:02 pm
by jorec
Hello,


Thanks people! Nothing easier!