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?