声明rect这个结构
Public Declare Function StartVideoPreview lib "dll名称"
(byval one as long,byval two as long,byval three as rect ,byval four as boolean,byval five as long ,byval six as long) as long

解决方案 »

  1.   

    这个怕是不行,提供给VB不能是这样的借口,字符串或许还有可能,但是Rect这样的结构指针,怕是不行了
      

  2.   

    agree suntteg.GetWindowRect下面的例子演示了如何在调用 Windows API 的函数后使用 LastDLLError 属性。PrintWindowCoordinates 过程接受一窗口句柄并调用 GetWindowRect 函数。GetWindowRect 在 RECT 数据结构中填入窗口矩形各边的边长。如果传递了一个无效句柄,就会出现错误,用 LastDLLError 属性可得到该错误代号。Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, _
                   lpRect As RECT) As Long      Type RECT
          Left As Long
          Top  As Long
          Right  As Long
          Bottom As Long
    End TypeConst ERROR_INVALID_WINDOW_HANDLE   As Long = 1400
    Const ERROR_INVALID_WINDOW_HANDLE_DESCR As String = "Invalid window handle."Sub PrintWindowCoordinates(hwnd As Long)
       ' 打印窗口的左、右、上、下的像素位置。
       
       Dim rectWindow As RECT
       
       ' 传入窗口句柄并清空该数据结构。
       ' 如果函数返回 0,出现错误。
       If GetWindowRect(hwnd, rectWindow) = 0 Then
          ' 如果由于传递无效句柄导致出现错误,
          ' 则检查 LastDLLError 并显示对话框。
          If Err.LastDllError = ERROR_INVALID_WINDOW_HANDLE Then
             MsgBox ERROR_INVALID_WINDOW_HANDLE_DESCR, _
                Title:="Error!"
          End If
       Else
          Debug.Print rectWindow.Bottom
          Debug.Print rectWindow.Left
          Debug.Print rectWindow.Right
          Debug.Print rectWindow.Top
       End If
    End Sub
      

  3.   

    ByRef传址!
    Public Declare Function StartVideoPreview lib "dll名称"
    (byval hChannelhandle as long,byval WndHandle as long,ByRef rct as rect ,byval bOverlay as Long,byval VideoFormat as long ,byval FrameRate as long) as long
      

  4.   

    注意加上__stdcall协议C里的BOOLEAN是32位的,所以用Long