RE: Null Point in IWMSContext.GetStringValue



UPDATE. I figured out why this was happening. Turns out that if you log an
error message to the WMS, then your plugin will get disabled. That doesn't
halt the current thread, though, and it doesn't kick out any other current
sessions from your plugin. Therefore, I was querying a context that was
created for a plugin that was now disabled. This would return null from the
context instance. You need to constantly check if your plugin is enabled or
not while processing WMS events, especially when you try to query any WMS
managed resource, like the context objects.

Once I stopped logging into the error log, everything started to work great.

--
Jacob W Anderson
---
http://www.beyond-ordinary.com
http://www.extremeplannerlive.com
---
If you think it''''s expensive to hire a professional to do the job, wait
until you hire an amateur.



"javatopia" wrote:

Hello,

I have a WMS9 digest authentication plugin written in C# and bound against
Microsoft.WindowsMediaServices 9.0.0.1 (Runtime 1.0.3705) and .NET 1.1

Today I am getting:

My Digest Authentication Plug-in: System.NullReferenceException: Object
reference not set to an instance of an object.

at
Microsoft.WindowsMediaServices.Interop.IWMSContext.GetStringValue(String
pstrName, Int32 lNameHint, String& pstrValue, Int32 lOptions)

at
WMS.AuthPlugin.MyAuthenticateContext.Microsoft.WindowsMediaServices.Interop.IWMSAuthenticationContext.Authenticate(Object
ResponseBlob, IWMSContext pUserCtx, IWMSContext pPresentationCtx,
IWMSCommandContext pCommandContext, IWMSAuthenticationCallback pCallback,
Object Context

The code where this is happening is:

void IWMSAuthenticationContext.Authenticate(object ResponseBlob, IWMSContext
pUserCtx, IWMSContext pPresentationCtx, IWMSCommandContext pCommandContext,
IWMSAuthenticationCallback pCallback, object Context)
{
// ....
pCommandContext.GetCommandRequest(out commandReq);

commandReq.GetStringValue("@ WMS_COMMAND_NAME", 153,
out strCommandName,
Convert.ToInt32(WMS_CONTEXT_OPTIONS.WMS_CONTEXT_GET_PROPERTY_STRING_BY_REFERENCE));

This is a recent development because in the past it has worked apparently
without this error. Has the WMS9 server been "hot fixed" through Windows
Update recently? Should I get a newer version of the WMS DLL? Is there any
other reason why this would fail?

Thanks


--
Jacob W Anderson
---
http://www.beyond-ordinary.com
http://www.accessquery.com
---
If you think it''s expensive to hire a professional to do the job, wait
until you hire an amateur.

.



Relevant Pages

  • C# WMS Authentication plugin enabling problem
    ... As far i read standard WMS plugins it's not possible to create this ... authentication plugin. ... public void EnablePlugin(ref int plFlags, ... MessageBox.Show(ex.Message, "Cannot Register", ...
    (microsoft.public.windowsmedia.server)
  • RE: WMS Server Referring URL
    ... plugin to hit all authorize events, e.g. play, stop, describe, etc. ... I am not using the WMS as an HTTP handler. ... event, but available at later stages (OPEN, PLAY events) ... I am writing an authorization plugin that needs to get the referring URL ...
    (microsoft.public.windowsmedia.server)
  • RE: WMS Server Referring URL
    ... An embedded player has to be used. ... plugin to hit all authorize events, e.g. play, stop, describe, etc. ... I am not using the WMS as an HTTP handler. ... I am writing an authorization plugin that needs to get the referring URL ...
    (microsoft.public.windowsmedia.server)
  • Re: Architectural Question on Remoting and UI Integration
    ... > I have an architectural question concerning the integration of UI elements ... The application loads a plugin into a separate AppDomain. ... > plugin has a form we wish to load into the placeholder as a child form (i.e., ... > Remoting cannot access private members properly across the context boundary. ...
    (microsoft.public.dotnet.framework.remoting)
  • Architectural Question on Remoting and UI Integration
    ... I have an architectural question concerning the integration of UI elements ... While it is possible to load and interact with forms belonging to another ... The application loads a plugin into a separate AppDomain. ... Remoting cannot access private members properly across the context boundary. ...
    (microsoft.public.dotnet.framework.remoting)

Loading