How to pass reference to function in VB.NET?

时间:2017-10-12 10:11:21

标签: vb.net vb6

I have a program that already written in VB6, now I need to change it to VB.NET, but I got System.AccessViolationException error.

VB6

Public result(512) As Byte
Private Declare Function getInfo Lib "abc" Alias "_GetInfo@12" (ByVal uiCom As Long, ByVal uiParam As Long, ucResult As Any) As Long
Dim isSuccess As Long
isSuccess = getInfo(0, 1, result(0))

VB.NET

Public result(512) As Byte
Private Declare Function getInfo Lib "abc" Alias "_GetInfo@12" (ByVal uiCom As Long, ByVal uiParam As Long, ucResult As Object) As Long
Dim isSuccess As Long
isSuccess = getInfo(0, 1, result(0))

Is it because the result is passing the value not the reference to function?

0 个答案:

没有答案