这个dll函数vb如何引用
int OpenComm(HANDLE *hCom,char *com_port)
vc的调用如下:
●——hCom:串口句柄
●——com_port:串口文件名
调用例程:
char comm[]="COM1";
OpenComm(&h_Com,comm);
if(h_Com != INVALID_HANDLE_VALUE)
{
AfxMessageBox("打开串口成功!");
}
else
{
AfxMessageBox("打开串口失败!");
}
//++====================================================
请问vb如何申明调用,我这样申明调用出错
Public Declare Function OpenComm Lib "EPCDemoDll.dll" (ByRef hand As long, ByVal com As String) As Integer
调用:
Dim hand As Long
Dim comPort As String
comPort = "COM1"
OpenComm hand, comPort
报错,错误号49
请大侠指点下