|
|
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.
|
|
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.
|
|
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.
|
|
Stas wrote:
[Quoted Text] > > Rest of the interfaces are working great. Any idea what gone wrong here? > > Thanks.
Does 'this' derive from IWMCredentialCallback?
|
|
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? >
|
|
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.
|
|
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. >
|
|
KBoek wrote:
[Quoted Text] > Sasha, can you help me translate the AcquireCredentials implementation to C#? >
Sorry, I'm quite unfamiliar with C# :(
|
|
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
|
|
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 > >
|
|
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?
|
|
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
|
|
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? :-)
|
|
|