Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
media
danimation.controls
danimation.programming
devices
drm
dshow.programming
dtransform
encoder
encoder.optimization
hometheaterpc
media
media.beta
media.beta.encoder
mediacenter
mediacenter.portable
mediaplayer
music.products
musicproducer
player
player.plugins
player.skins
player.solaris
player.visualizations
player.web
sdk
server
tools
  
 
date: Tue, 29 Apr 2008 11:49:29 +0300,    group: microsoft.public.windowsmedia.sdk        back       


cant get custom logging plugin to work.   
Hello All.

Im using modified code from Windows Media Server SDK sample to create a 
plugin for direct logging to database. All elements of the code work except 
where it goes to get the logs from server, that part always ends up with a 
error no matter what is done.

Original SDK sample code file name: VBDBLoggingPlugin.vb

Enviroment;
Windows Server 2008 Enteprirse, Media Services for Server 2008, Visual 
Studio 2008

Namespace imports;
Imports WMSServerLib
Imports System.Text
Imports System.Runtime.InteropServices
Imports Microsoft.Win32

Calling code;

            CommandCtx.GetCommandRequest(CommandRequest)
            CommandRequest.GetIUnknownValue( "@WMS_COMMAND_CONTEXT_BODY", 
11, ContextBody, 0)
            NsBuffer = ContextBody
            If NsBuffer Is Nothing Then
                Exit Sub
            End If
            strContext = GetStringFromNSSBuffer(NsBuffer)

Function (where error occures) ;

    Private Function GetStringFromNSSBuffer(ByRef NsBuffer As INSSBuffer) As 
String
        Dim s As String = ""
        GetStringFromNSSBuffer = ""
        Try
            Dim uBufSize As UInt32
            Dim pbuf As IntPtr = New IntPtr()
            NsBuffer.GetBufferAndLength(pbuf, uBufSize)
            Dim iBufSize As Int32 = Convert.ToInt32(uBufSize) / 2
            s = Marshal.PtrToStringUni(pbuf, iBufSize)
            GetStringFromNSSBuffer = s
        Catch
        End Try
    End Function

Error;
Value does not fall within the expected range.
date: Tue, 29 Apr 2008 11:49:29 +0300   author:   Malrock 1001

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us