在VB中使用指针调用

时间:2013-02-12 01:36:49

标签: .net vb.net pointers

如何从VB中的XLDownload.dll调用此函数?

DWORD __stdcall QueryTaskInfo(LONG lTaskId, LONG *plStatus, ULONGLONG *pullFileSize, ULONGLONG *pullRecvSize);

我尝试使用ByRef ULong和ByVal IntPtr来调用但不起作用。它们都会导致PInvokeStackImbalance错误。

1 个答案:

答案 0 :(得分:1)

<DllImport("XLDownload.dll", CharSet := CharSet.Auto, SetLastError := True, BestFitMapping := False, CallingConvention := CallingConvention.StdCall)> _
Private Shared Function QueryTaskInfo(lTaskId As UInt32, ByRef plStatus As UInt32, ByRef pullFileSize As UInt64, ByRef pullRecvSize As UInt64) As UInt32
End Function