Interface to class casts
- From: Jack Hughes <jhughes@xxxxxxxxxxxxxx>
- Date: Tue, 16 Jan 2007 17:45:59 +0000
I have a couple of C++ classes CCar and CWheel implementing the ICar and IWheel interfaces respectively.
One of ICar methods (and implemented by CCar) is AddWheel(IWheel* aNewWheel).
One of the problems I have is that I need to access the CWheel class instead of just going through IWheel for doing RDB persistence. I don't want to clutter up the IWheel interface with this kind of implementation detail.
How do I safely go from a IWheel* to the respective CWheel* in the AddWheel method?
As I understand it, IWheel* is a super class of CWheel so one of the C++ casts should do the job?
Any help much appreciated.
Regards,
Jack
.
- Follow-Ups:
- Re: Interface to class casts
- From: Brian Muth
- Re: Interface to class casts
- Prev by Date: Re: Tracing CComBSTR leaks
- Next by Date: Re: proxy/stub woes
- Previous by thread: proxy/stub woes
- Next by thread: Re: Interface to class casts
- Index(es):
Relevant Pages
|