> From: "dl0"
>
> > What about this?
>
> People have lives, you know?
>
> > I'm currently attempting to do the CreateIndexer method of
> > doing
> > this. Where I am stuck at is where you assign the
> > OnStatus callback
> > explicitly in the
>
> > hr = m_pIndexer->StartIndexing( pwszOutputFile,
> > &CWMVCopy::OnStatus,
> > NULL );
>
> > call. This isn't working because of a casting issue.
>
> Why would you expect it to work? The method expects a
> pointer to a class (IWMStatusCallback*) while you are trying
> to pass a pointer to a virtual method. The callback is *not*
> a function but an interface.
>
> > I found where
> > he appears to be templatizing each of the callbacks but I
> > don't see
> > any assignment there.
>
> There are no templates in the sample.
>
> > Also, I haven't quite clued into where the
> > assignment of these things is happening for the other
> > interfaces that
> > us OnStatus.
>
> IWMReaderCallbackAdvanced : IWMReaderCallback :
> IWMStatusCallback : IUnknown
>
> The sample is using IWMReaderCallbackAdvanced and not just
> IWMStatusCallback, but IWMReaderCallbackAdvanced inherits
> IWMStatusCallback.
>
> > Since he appears to be templatizing everything and then
> > doing an AddRef for each using the same pointer, I'm not
> > exactly sure
> > how you "get it back".
>
> Again, there are no templates and, if you are referring to
> the implementation of CWMVCopy::QueryInterface(), it is not
> AddRef()ing the same pointer but the same object instance
> (itself) and returning different pointers, depending on the
> branch that gets executed, which are just stored in the same
> result parameter.
>
> > If I can find that pointer in the above
> > function call (as far as I understand) it seems I can pass
> > it to the
> > StartIndexing method.
>
> As the sample shows when using IWMReaderCallbackAdvanced,
> you need to use 'this' to let the compiler cast it to a
> reference to IWMStatusCallback (see the call to
> m_pReader->Open()). Also, notice that you will get the same
> CWMVCopy::OnStatus() implementation the sample uses for the
> copy, which may or may not work for the indexing.
>
> > The program claims indexing is on but it isn't in the
> > files I'm
> > downloading so I started my attempt; I'm stuck at the
> > point I
> > mentioned but I'm still looking.
>
> It occurred to me now that the problem may also be the
> seekable and stridable flags in the streaming header, which
> should be false while you need true. In
> CWMVCopy::CopyAttribute(), after all the attributes have
> been copied, set those 2 attributes to true.
>
> --
> // Alessandro Angeli
> // MVP :: DirectShow / MediaFoundation
> // mvpnews at riseoftheants dot com
> //
http://www.riseoftheants.com/mmx/faq.htm