VB动态链接库调用问题

来源:百度知道 编辑:UC知道 时间:2024/06/07 20:56:32
VC头文件中函数:
SEFUNCTIONS_API void __stdcall SetReportMode(enum epMode eMode);
其中epMode为:
enum epMode
{
V,
D,
W
};
就是在接收数据以前,先设置接收数据的类型,在VB中应该怎样调用?

你参考一下调用系统的API的型式,先声明epMode 的类型就好像这样的

Public Type POINTS
x As Integer
y As Integer
End Type
然后再声明SetReportMode,应该就可以了

添加引用

private function SetReportMode lib "你的文件的.dll" (byval mode as long)

enum好像vc最后是生成一个整形的数的 ,用 long应该可以了。

不过函数名字可能还要改一下,