Re: ATL inheritance mistake
On 29 Dic, 14:23, "Igor Tandetnik" <itandet...@mvps.org> wrote:
I'm afraid I don't know VB well enough to help you here. I don't see anything obviously wrong in your C++ code. Consider asking in microsoft.public.vb.com .
Thanks for you intresting Igor.
I'm doing some tests, unfortunatelly I'm not an expert on ATL..
I'm thinking that the problem could be because I wanna use events from
an AudioDecoder object like it was an AudioRecorder.
So I thought: how can I use and AudioDecoder like it was an
AudioRecorder?
I try to change the AudioDecoder coclass to implement also the
IAudioRecorderEvents...
coclass AudioDecoder
{
interface IAudioDevice;
interface IAudioRecorder;
[default] interface IAudioDecoder;
[source] dispinterface _IAudioRecorderEvents;
[default, source] dispinterface _IAudioDecoderEvents;
};
But, now? How can I code for this new design? I try to add a new
CONNECTION_POINT_ENTRY:
BEGIN_CONNECTION_POINT_MAP(CAudioDecoder)
CONNECTION_POINT_ENTRY(__uuidof(_IAudioDecoderEvents))
CONNECTION_POINT_ENTRY(__uuidof(_IAudioRecorderEvents))
END_CONNECTION_POINT_MAP()
But I get:
1>\src\audiodecoder.h(71) : error C2440: 'static_cast' : cannot
convert from 'CAudioDecoder::_atl_conn_classtype *' to
'ATL::_ICPLocator<piid> *'
1> with
1> [
1> piid=& DIID__IAudioRecorderEvents
1> ]
1> Types pointed to are unrelated; conversion requires
reinterpret_cast, C-style cast or function-style cast
Have you some suggestions?
BR,
Daniele.