0

.h 文件包含以下签名:

typedef void (RTMP_LogCallback)(int level, const char *fmt, va_list);
void RTMP_LogSetCallback(RTMP_LogCallback *cb);

我想在 VB.NET 应用程序中使用它,所以我尝试了这种方式:

<DllImport("librtmp.dll", CallingConvention:=CallingConvention.Cdecl)>
Public Shared Sub RTMP_LogSetCallback(cb As LogCallback)
End Sub

<UnmanagedFunctionPointer(CallingConvention.Cdecl)>
Public Delegate Sub LogCallback(level As LogLevel, message As String, args As IntPtr)

...

Private m_LogCallback As New LibRtmp.LogCallback(AddressOf LogCallback)
Private Sub LogCallback(lvl As LibRtmp.LogLevel, message As String, args As IntPtr)
    Console.WriteLine(message)
End Sub

args包含一个似乎是参数数组指针的整数。

如何从该数组中获取值?

4

0 回答 0