Hi Guys,
I am developing an application which uses a com dll.
The com dll provides 2 classes, which inherit from another class.
Class B inherits from A
Class C inherits from A
I'm looking for a design pattern and an example how to implement my problem.
The 2 derives classes are very similar and have the same properties and methods for 95%.
So I would like to create ONE new derived class "E" (for both B and C) in my project which also have the same methods and properties for 95%. I do not want to write all functions twice for each class I inherit.
So I want class E to figure out if its derived from B or C.
What would be the best way to solve this, using maybe a design pattern, and can you please provide a short example.
Thanks, William

Pranay RanaRank #735 · 3.2K reputationPosted Jul 9, 2015, 3:20 AM EDT
Upendra Pratap ShahiRank #329 · 7.5K reputationPosted Jul 9, 2015, 2:40 AM EDT
Pranay RanaRank #735 · 3.2K reputationPosted Jul 9, 2015, 3:21 AM EDT
William van Aert3 reputationPosted Jul 9, 2015, 4:06 AM EDT
Pranay RanaRank #735 · 3.2K reputationPosted Jul 9, 2015, 4:16 AM EDT
Upendra Pratap ShahiRank #329 · 7.5K reputationPosted Jul 9, 2015, 4:27 AM EDT