469,938 Members | 2,496 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,938 developers. It's quick & easy.

Catastrophic Failure

I try to create wrapper for WMSyncReader. The code is :using System;
using System.Runtime.InteropServices;
namespace WMFSDKWrapper
{
public class WMFSDKFunctions
{
[DllImport("WMVCore.dll", EntryPoint="WMCreateSyncReader",
SetLastError=true,
CharSet=CharSet.Unicode, ExactSpelling=true,
CallingConvention=CallingConvention.StdCall)]
public static extern uint WMCreateSyncReader(
[In,MarshalAs(UnmanagedType.IUnknown)] System.Object
pUnkReserved,
[In] short dwRights,
[Out,MarshalAs(UnmanagedType.Interface)] out IWMSyncReader
ppReader);
public WMFSDKFunctions()
{
//
// TODO: Add constructor logic here
//
}
}

[Guid("9397F121-7705-4DC9-B049-98B698188414"),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown )]
public interface IWMSyncReader
{
uint Open(
[In,MarshalAs(UnmanagedType.LPWStr)] string pwszFilename);
}
}

When i call the class using this code :

string pwszInFile = @"c:\test.wma";
IWMSyncReader ppSyncReader
WMFSDKFunctions.WMCreateSyncReader(null, 0, out ppSyncReader );
ppSyncReader.Open( pwszInFile ) ;

I got the message : "Catastrophic Failure"
Can anyone advise me of the best approach to doing this through .NET?
Many thanks...
Nov 16 '05 #1
0 1924

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by J. Marshall Latham | last post: by
1 post views Thread by sakthisakthi | last post: by
reply views Thread by Veibert M Pinontoan | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.