ObjectARX的acedGrRead()在VB.NET中該如何使用?
該方法的第三個引數,在vb.net中和C++有些不同,現在我程式中可以呼叫到,但第三個引數始終沒有值,各位大俠幫忙解決解決,謝謝。
下面是我在VB.NET中的使用代碼:
<DllImport("accore.dll", CallingConvention:=CallingConvention.Cdecl, EntryPoint:="acedGrRead")>
Public Shared Function acedGrRead(ByVal track As Integer, ByRef type As Integer, ByRef res As IntPtr) As Integer
End Function
Public Sub test()
Dim p As IntPtr
Dim type As Integer = 3
acedGrRead(1, type , p)
'type可以根據觸發的方式正確回傳,如鍵盤輸入,滑鼠左右鍵,移動等
'但第三個引數 p 始終都是回傳Zero,不知道是怎么回事?
If p <> IntPtr.Zero Then
Dim rb As ResultBuffer = ResultBuffer.Create(Res, True)
rb.Dispose()
End If
End Sub
是使用方法有問題嗎?請各位高手指教。
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/275295.html
標籤:VB.NET
