Working with both TRichViewEdit and TDBRichViewEdit

General TRichView support forum. Please post your questions here
Post Reply
jorec
Posts: 3
Joined: Thu Jul 06, 2006 8:05 pm

Working with both TRichViewEdit and TDBRichViewEdit

Post 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.
Michel
Posts: 92
Joined: Fri Oct 14, 2005 2:56 pm
Contact:

Post 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
Sergey Tkachenko
Site Admin
Posts: 17555
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Yes, use their common ancestor - TCustomRichViewEdit.

Class hierarchy:

Code: Select all

TCustomRichView
| | |
| | TRichView
| |
|  TDBRichView
|
TCustomRichViewEdit
| |
| TRichViewEdit
|
TDBRichViewEdit
jorec
Posts: 3
Joined: Thu Jul 06, 2006 8:05 pm

Post by jorec »

Hello,


Thanks people! Nothing easier!
Post Reply