Article View: borland.public.cppbuilder.multimedia
Article #288Re: custom writer sink problem
From: Jonathan Benedicto
Date: Mon, 03 Jan 2005 17:44
Date: Mon, 03 Jan 2005 17:44
61 lines
3096 bytes
3096 bytes
Here is the code that I use to add the custom sink to the writer.
hr = pWriter->QueryInterface(IID_IWMWriterAdvanced,
(void**)&pWriterAdvanced);
if(FAILED(hr)){
SendError("Couldn't initialize advanced writer.");
pWriter->Release();
return;
}
pCustomSink = new TWMCustomSink(FileName->Caption);
hr = pWriterAdvanced->AddSink(pCustomSink);
if(FAILED(hr)){
SendError("Couldn't add sink.");
pWriter->Release();
pCustomSink->Release();
return;
}
I found out that the QueryInterface is requesting IID_IWMWriterFileSink3. So
I just return E_NOINTERFACE.
I have read that article, yes.
--
Jonathan
"Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message
news:41d70359$1@newsgroups.borland.com...
>
> "Jonathan Benedicto" <incorrect@no.server> wrote in message
> news:41d5ae65$1@newsgroups.borland.com...
>
>> I've tried to build my own custom writer sink using the windows media
>> format sdk, but although the app runs fine, the writer sink's OnDataUnit
>> method is never called.
>
> Did you register the sink with IWMWriter? If it does not know about your
> sink, it obviously can't use it.
>
>> The QueryInterface is called twice, neither time asking for IID_IUnknown
>> or IID_IWMWriterSink or IID_IWMRegisterCallback.
>
> What exactly does it ask for? My guess would be that it is looking for
> either IID_IWMWriterFileSink, IID_IWMWriterNetworkSink, or
> IID_IWMWriterPushSink. Those are the three types that IWMWriter supports
> by
> default. If that turns out to be the case, then I would surmise that your
> sink is not being set up correctly.
>
> Have you read the following article yet?
>
> Working with Writer Sinks
>
> http://msdn.microsoft.com/library/en-us/wmform95/htm/workingwithwritersinks.asp
>
>
> Gambit
>
>
Technical Details
Message-ID:
<41d98468@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!newsgate.cistron.nl!feeder1.cambrium.nl!feed.tweaknews.nl!news2.euro.net!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<41d5ae65$1@newsgroups.borland.com> <41d70359$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10d0fc,e2e3d27f003f4ca5 X-Google-Attributes: gid10d0fc,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Jonathan Benedicto" <incorrect@no.server> Newsgroups: borland.public.cppbuilder.multimedia References: <41d5ae65$1@newsgroups.borland.com> <41d70359$1@newsgroups.borland.com> Subject: Re: custom writer sink problem Date: Mon, 3 Jan 2005 12:44:06 -0500 Lines: 63 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-RFC2646: Format=Flowed; Original NNTP-Posting-Host: 64.231.16.86 Message-ID: <41d98468@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1104774248 64.231.16.86 (3 Jan 2005 09:44:08 -0800) Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!newsgate.cistron.nl!feeder1.cambrium.nl!feed.tweaknews.nl!news2.euro.net!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail