c++中方法是这样的BOOL TKLNETCLIENT_SetVideoWindow(ULONG IPlayer,HWND hWnd,RECT* pRect=NULL);
在c#该怎么写呢?
[DllImport("TKLPlayer.dll", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
public static extern bool TKLNETCLIENT_SetVideoWindow(???);

解决方案 »

  1.   

    unsigned long System.UInt32 32 位  
    HWND IntPtr
    Rect
    [StructLayout(LayoutKind.Explicit]   
    public   struct   Rect   {   
    [FieldOffset(0)]   public   int   left;   
    [FieldOffset(4)]   public   int   top;   
    [FieldOffset(8)]   public   int   right;   
    [FieldOffset(12)]   public   int   bottom;   
    }   
      

  2.   

    感谢高手,如果我把ULONG  改成int32不知可以不?
      

  3.   

    貌似这个rect不接受null类型的参数!怎么办呢?
      

  4.   

    [DllImport("TKLPlayer.dll", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
    public static extern bool TKLNETCLIENT_SetVideoWindow(uint32 IPlayer,IntPtr hWnd,ref Rect pRect);