现在有个C++动态链接库,有头文件,但是我想在VB里面调用。怎么在VB里面调用啊、麻烦帮忙把下面的3个函数转成能在VB里面用的语句。
之前没接触过VB,现在因为时间紧,需要临时突击下。麻烦帮忙解答下啊。
#ifndef C_DLL
#define C_DLLEXPORT extern "C" __declspec(dllexport)
#define C_DLLIMPORT extern "C" __declspec(dllimport)
#endif
C_DLLEXPORT int Setup(HANDLE hCom, DWORD baudRate= 9600, BYTE parity=NOPARITY, BYTE datasize=8, BYTE stopbits=ONESTOPBIT, DWORD timeOut= 1000, DWORD readBufferSizes=256, DWORD writeBufferSizes=256);
C_DLLEXPORT int Write(HANDLE hCom, char* pbuffer);
C_DLLEXPORT int Read (HANDLE hCom, char* pbuffer);
http://jingyan.baidu.com/article/36d6ed1f08a9d41bce48836f.html
http://blog.chinaunix.net/uid-123195-id-2945594.html
regsrv32 X.dll, 然后在VB中引用这个dll
Declare Function Setup Lib "yourdllname.dll" (byval hCom as long, byval baudRate as long, byval parity as byte, byval datasize as byte, byval stopbits as byte, byval timeOut as long, byval readBufferSizes as long, byval writeBufferSizes as long) as long
Declare Function Write Lib "yourdllname.dll" (byval hCom as long, byval pbuffer() as byte) as long
Declare Function Read Lib "yourdllname.dll" (byval hCom as long, byval pbuffer() as byte) as long
指针类型变量怎么改类型啊.