我正在尝试用 C++ 创建一个 dll 导出函数,以便从 VB.NET 导入。
我已经创建了函数,但我不知道在调用中使用的等效参数类型是什么。
在 C++ 中:
__declspec(dllexport) BOOL myFunction( const float *data, const char* filePath );
在 vb.NET 中:
<DllImport("myDLL.dll", _
EntryPoint:="myFunction", CallingConvention:=CallingConvention.StdCall)> _
Public Shared Function myVBFunction( ByVal data As something, _
ByVal filePath As String) As Boolean
End Function
有人能告诉我float *data
类型(这将是一种图像格式)使用什么吗?如果我可以使用String
来传递filePath
- 将作为 char*
接收 - 或者我必须使用什么来代替?
非常感谢。
最佳答案
C++ 中的 float
映射到 VB.NET 中的 Single
数据类型。
filePath
的 char*
在 VB.NET 中应该是 String
。
关于c++ - 将 c++ dll 导入 vb.net 时,float*(图像类型)的等效数据类型是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18972651/