vb中的代碼:
Public Class Form1
Private Declare Function func Lib "C:\UniversalViewInterfaceDll.dll" (ByRef res As String) As Long
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
func(res)
Label5.Text = resToVb
End Sub
End Class
c++的代碼:
extern "C" {
int func(char*& s)
{
s = "aaaaa";
}
}
值都能傳回來,但是報例外:
引發的例外:“System.AccessViolationException”(位于 mscorlib.dll 中)
“System.AccessViolationException”型別的未經處理的例外在 mscorlib.dll 中發生
其他資訊: 嘗試讀取或寫入受保護的記憶體。這通常指示其他記憶體已損壞。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/107894.html
標籤:其他開發語言
上一篇:SpringMVC
下一篇:python tolist 方法
