从函数返回指针引用C ++指针

时间:2016-10-06 13:06:23

标签: c++ vb.net pointers

目前我停留在来自C ++未损坏DLL的函数调用上。

它具有获取值的功能。但是函数的返回值是布尔值(如果没有错误,则为true)。我们想要的值是其中一个参数:const char** value如果我正确理解C ++,这是指向指针的指针。通常,可以在.net中使用ByRef处理指针,更改您输入的值。但是我不知道如何获得指向指针的指针。

短篇小说: 如何转换:

extern "C" __EXPORT bool funcName(const char** value)

到C#/ VB.net

这适用于const char* value,但不适用于const char** value

<DllImport("Path_To_Dll.Dll", CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function FuncName(ByRef GetValue as string) as boolean
End Function

Dim HereReturnValue as string

Private Function GetValue() as string
    FuncName(HereReturnValue)
    Return HereReturnValue
End Function

0 个答案:

没有答案