Werbung: SecurityConsole.de verwaltet Ihre Computer mit Security Essentails aus der Cloud!
30 Tage kostenfrei testen und 20% Rabatt für Ihre Bestellung mit Promocode: WBF2685582
(Promocode gültig bis 31.12.2011)

Group:  English: Entertainment » microsoft.public.windowsmedia.sdk
Thread: Unable to query for IWMCredentialCallback interface

HTVi
TV Discussion Newsgroups

Unable to query for IWMCredentialCallback interface
Stas 4/16/2007 6:52:03 PM
Hi.

I'm trying to extend one of the SDK examples to work with
IWMCredentialCallback. When I'm using the following code in the
QueryInterface() function, the application crashes:

*ppvObject = ( IWMCredentialCallback* )this;

but when I'm using the following one:

*ppvObject = static_cast< IWMCredentialCallback * >( this );

the application complains about being unable to convert 'SomeClass *const to
IWMCredentialCallback *'.

Rest of the interfaces are working great. Any idea what gone wrong here?

Thanks.
RE: Unable to query for IWMCredentialCallback interface
KBoek 4/16/2007 7:38:04 PM
You have to call QueryInterface on the push sink to get the
IWMRegisterCallback interface. Call its Advise method to let the system hook
on to status messages that are sent from the push object.

Then, implement the IWMStatusCallback and the IWMCredentialCallback in your
application and see the method OnStatus getting called on every status change
of the push sink. If the server needs authentication, it will call your
application's IWMCredentialCallback::AcquireCredentials method.

If you send me your email address, I'd be glad to send you how I extended
the C++ NetWrite example of the WMF SDK (If you dont want to publish your
email address here, send it to kboek [at] hotmail [dot] com)

I came at least that far that the AcquireCredentials gets called. But I'm
struggling with getting authentication right, it replies with "access denied"
although I'm sure of the right creds.

Regards,
Karel

"Stas" wrote:

[Quoted Text]
> Hi.
>
> I'm trying to extend one of the SDK examples to work with
> IWMCredentialCallback. When I'm using the following code in the
> QueryInterface() function, the application crashes:
>
> *ppvObject = ( IWMCredentialCallback* )this;
>
> but when I'm using the following one:
>
> *ppvObject = static_cast< IWMCredentialCallback * >( this );
>
> the application complains about being unable to convert 'SomeClass *const to
> IWMCredentialCallback *'.
>
> Rest of the interfaces are working great. Any idea what gone wrong here?
>
> Thanks.
RE: Unable to query for IWMCredentialCallback interface
Stas 4/16/2007 7:44:00 PM
Thanks, mail sent.

"KBoek" wrote:

[Quoted Text]
> You have to call QueryInterface on the push sink to get the
> IWMRegisterCallback interface. Call its Advise method to let the system hook
> on to status messages that are sent from the push object.
>
> Then, implement the IWMStatusCallback and the IWMCredentialCallback in your
> application and see the method OnStatus getting called on every status change
> of the push sink. If the server needs authentication, it will call your
> application's IWMCredentialCallback::AcquireCredentials method.
>
> If you send me your email address, I'd be glad to send you how I extended
> the C++ NetWrite example of the WMF SDK (If you dont want to publish your
> email address here, send it to kboek [at] hotmail [dot] com)
>
> I came at least that far that the AcquireCredentials gets called. But I'm
> struggling with getting authentication right, it replies with "access denied"
> although I'm sure of the right creds.
>
> Regards,
> Karel
>
> "Stas" wrote:
>
> > Hi.
> >
> > I'm trying to extend one of the SDK examples to work with
> > IWMCredentialCallback. When I'm using the following code in the
> > QueryInterface() function, the application crashes:
> >
> > *ppvObject = ( IWMCredentialCallback* )this;
> >
> > but when I'm using the following one:
> >
> > *ppvObject = static_cast< IWMCredentialCallback * >( this );
> >
> > the application complains about being unable to convert 'SomeClass *const to
> > IWMCredentialCallback *'.
> >
> > Rest of the interfaces are working great. Any idea what gone wrong here?
> >
> > Thanks.
Re: Unable to query for IWMCredentialCallback interface
sasha <abc[ at ]fox.net> 4/16/2007 9:39:35 PM
Stas wrote:
[Quoted Text]
>
> Rest of the interfaces are working great. Any idea what gone wrong here?
>
> Thanks.

Does 'this' derive from IWMCredentialCallback?
Re: Unable to query for IWMCredentialCallback interface
Stas 4/17/2007 4:08:01 PM
Hi Sasha.

Yes, that's exactly what I forgot to do :). Deriving the class from
IWMCredentialCallback resolves the issue.

Regards,
Stas.

"sasha" wrote:

[Quoted Text]
> Does 'this' derive from IWMCredentialCallback?
>
Re: Unable to query for IWMCredentialCallback interface
sasha <abc[ at ]fox.net> 4/17/2007 4:24:25 PM
Stas wrote:
[Quoted Text]
> Hi Sasha.
>
> Yes, that's exactly what I forgot to do :). Deriving the class from
> IWMCredentialCallback resolves the issue.
>

That's why the C++ cast is preferable to the old C cast - you get
informative diagnostics from the compiler.
Re: Unable to query for IWMCredentialCallback interface
KBoek 4/17/2007 4:36:01 PM
Sasha, can you help me translate the AcquireCredentials implementation to C#?

"sasha" wrote:

[Quoted Text]
> Stas wrote:
> > Hi Sasha.
> >
> > Yes, that's exactly what I forgot to do :). Deriving the class from
> > IWMCredentialCallback resolves the issue.
> >
>
> That's why the C++ cast is preferable to the old C cast - you get
> informative diagnostics from the compiler.
>
Re: Unable to query for IWMCredentialCallback interface
sasha <abc[ at ]fox.net> 4/17/2007 5:38:31 PM
KBoek wrote:
[Quoted Text]
> Sasha, can you help me translate the AcquireCredentials implementation to C#?
>

Sorry, I'm quite unfamiliar with C# :(
Re: Unable to query for IWMCredentialCallback interface
dl0 <dl0banter[ at ]gmail.com> 5/18/2007 8:58:45 PM
On Apr 17, 10:08 am, Stas <S...[ at ]discussions.microsoft.com> wrote:
[Quoted Text]
> Hi Sasha.
>
> Yes, that's exactly what I forgot to do :). Deriving the class from
> IWMCredentialCallback resolves the issue.
>
> Regards,
> Stas.
>
>
>
> "sasha" wrote:
> > Does 'this' derive from IWMCredentialCallback?- Hide quoted text -
>
> - Show quoted text -

Hi... apparently you got this OnAcquireCredentials or something
similar to work in C#? I was wondering if you had some code that
demonstrated this? I'm attempting to implement a push distributation
to a media server from an encoder... When I do that I'm getting the
"invalid username" thing. How are you passing your credentials?

Thanks,
dl0

Re: Unable to query for IWMCredentialCallback interface
KBoek 5/21/2007 10:55:01 AM
Hi, sorry for my late reply. I don't have much time now, but shortly you have
to implement the AcquireCredentials method from the WMF SDK in your project,
since the OnAcquireCredentials that is in the WM Encoder SDK won't work.

I can send you some sample code later, but it's busy now; contact me at
kboek [at] hotmail [dot] com for more info.

Regards,
Karel

"dl0" wrote:

[Quoted Text]
> On Apr 17, 10:08 am, Stas <S...[ at ]discussions.microsoft.com> wrote:
> > Hi Sasha.
> >
> > Yes, that's exactly what I forgot to do :). Deriving the class from
> > IWMCredentialCallback resolves the issue.
> >
> > Regards,
> > Stas.
> >
> >
> >
> > "sasha" wrote:
> > > Does 'this' derive from IWMCredentialCallback?- Hide quoted text -
> >
> > - Show quoted text -
>
> Hi... apparently you got this OnAcquireCredentials or something
> similar to work in C#? I was wondering if you had some code that
> demonstrated this? I'm attempting to implement a push distributation
> to a media server from an encoder... When I do that I'm getting the
> "invalid username" thing. How are you passing your credentials?
>
> Thanks,
> dl0
>
>
Re: Unable to query for IWMCredentialCallback interface
dl0 <dl0banter[ at ]gmail.com> 5/22/2007 3:54:23 PM
On May 21, 4:55 am, KBoek <K...[ at ]discussions.microsoft.com> wrote:
[Quoted Text]
> Hi, sorry for my late reply. I don't have much time now, but shortly you have
> to implement the AcquireCredentials method from the WMF SDK in your project,
> since the OnAcquireCredentials that is in the WM Encoder SDK won't work.
>
> I can send you some sample code later, but it's busy now; contact me at
> kboek [at] hotmail [dot] com for more info.
>
> Regards,
> Karel
>
>
>
> "dl0" wrote:
> > On Apr 17, 10:08 am, Stas <S...[ at ]discussions.microsoft.com> wrote:
> > > Hi Sasha.
>
> > > Yes, that's exactly what I forgot to do :). Deriving the class from
> > > IWMCredentialCallback resolves the issue.
>
> > > Regards,
> > > Stas.
>
> > > "sasha" wrote:
> > > > Does 'this' derive from IWMCredentialCallback?- Hide quoted text -
>
> > > - Show quoted text -
>
> > Hi... apparently you got this OnAcquireCredentials or something
> > similar to work in C#? I was wondering if you had some code that
> > demonstrated this? I'm attempting to implement a push distributation
> > to a media server from an encoder... When I do that I'm getting the
> > "invalid username" thing. How are you passing your credentials?
>
> > Thanks,
> > dl0- Hide quoted text -
>
> - Show quoted text -

I have implemented the interface and OnAcquireCredentials. I'm having
trouble finding where I specify the library to attach to (or the COM
object). This is just "supposed to happen" according to the
documentation but I don't see OnAcquireCredentials executing at all
when I'm starting my application. I found code on the web that
allowed for the definition of the IWMCredentialCallback interface and
a version of OnAcquireCredentials. This went into the code and
compiles fine. It never runs.

What's going on here and why is something so innanely stupid as
authentical credentials actually *hard* to implement or undocumented?

Re: Unable to query for IWMCredentialCallback interface
dl0 <dl0banter[ at ]gmail.com> 5/22/2007 6:28:05 PM
On May 21, 4:55 am, KBoek <K...[ at ]discussions.microsoft.com> wrote:
[Quoted Text]
> Hi, sorry for my late reply. I don't have much time now, but shortly you have
> to implement the AcquireCredentials method from the WMF SDK in your project,
> since the OnAcquireCredentials that is in the WM Encoder SDK won't work.
>
> I can send you some sample code later, but it's busy now; contact me at
> kboek [at] hotmail [dot] com for more info.
>
> Regards,
> Karel
>
>
>
> "dl0" wrote:
> > On Apr 17, 10:08 am, Stas <S...[ at ]discussions.microsoft.com> wrote:
> > > Hi Sasha.
>
> > > Yes, that's exactly what I forgot to do :). Deriving the class from
> > > IWMCredentialCallback resolves the issue.
>
> > > Regards,
> > > Stas.
>
> > > "sasha" wrote:
> > > > Does 'this' derive from IWMCredentialCallback?- Hide quoted text -
>
> > > - Show quoted text -
>
> > Hi... apparently you got this OnAcquireCredentials or something
> > similar to work in C#? I was wondering if you had some code that
> > demonstrated this? I'm attempting to implement a push distributation
> > to a media server from an encoder... When I do that I'm getting the
> > "invalid username" thing. How are you passing your credentials?
>
> > Thanks,
> > dl0- Hide quoted text -
>
> - Show quoted text -


I have code you posted for the OnAcquireCredentials and all that.
What I'm curious about now is the QueryInterface stuff. This seems to
me the stuff I need to do before I can hook in and get an
OnAcquireCredentials event. I have implemented the callback interface
the way you specified and implemented the OnAcquireCredentials method
to handle the event but the event is never happening... what's the
process of hooking in so I can the events?
D

Re: Unable to query for IWMCredentialCallback interface
dl0 <dl0banter[ at ]gmail.com> 5/22/2007 6:31:05 PM
On May 21, 4:55 am, KBoek <K...[ at ]discussions.microsoft.com> wrote:
[Quoted Text]
> Hi, sorry for my late reply. I don't have much time now, but shortly you have
> to implement the AcquireCredentials method from the WMF SDK in your project,
> since the OnAcquireCredentials that is in the WM Encoder SDK won't work.
>
> I can send you some sample code later, but it's busy now; contact me at
> kboek [at] hotmail [dot] com for more info.
>
> Regards,
> Karel
>
>
>
> "dl0" wrote:
> > On Apr 17, 10:08 am, Stas <S...[ at ]discussions.microsoft.com> wrote:
> > > Hi Sasha.
>
> > > Yes, that's exactly what I forgot to do :). Deriving the class from
> > > IWMCredentialCallback resolves the issue.
>
> > > Regards,
> > > Stas.
>
> > > "sasha" wrote:
> > > > Does 'this' derive from IWMCredentialCallback?- Hide quoted text -
>
> > > - Show quoted text -
>
> > Hi... apparently you got this OnAcquireCredentials or something
> > similar to work in C#? I was wondering if you had some code that
> > demonstrated this? I'm attempting to implement a push distributation
> > to a media server from an encoder... When I do that I'm getting the
> > "invalid username" thing. How are you passing your credentials?
>
> > Thanks,
> > dl0- Hide quoted text -
>
> - Show quoted text -

If more than one post appears I apologize. The system seems to be
spitting out my replies and not posting them.

I'm at the point now where I have everything with OnAcquireCredentials
implemented but I'm not hooked in. I keep finding little bits and
pieces around the net about how to do this. I'm at the point of
needing to do the QueryInterface stuff to get the interface to invoke
Advise on. My OnAcquire method for the credentials isn't getting
executed so my app isn't hooked in to get these events...

What's up with this part of the process? WHY DIDN'T THEY JUST PUT A
UID AND PASSWORD ON THE ENCODER OBJECT? :-)

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net
Suche nach Orten, Städten, Postleitzahlen, Vorwahlen, Kfz-Kennzeichen