[問題] VC++寫成的DLL 無法在VB被呼叫
我參考這一篇用vc++寫成的dll
http://msdn.microsoft.com/en-us/library/ms235638(VS.80).aspx
現在我只要函式所傳的是陣列 編譯沒問題
但在vb去呼叫時 他會寫
'xxxx' 含有一個不支援的傳回型別或多個不支援的參數型別。
我直覺是陣列宣告錯誤 請問陣列的宣告方式要怎麼去寫
using namespace System;
namespace I2C_PacketTransport
{
public ref class I2C_PacketTransport
{
public:
static int NI845_Init(int32 Is10Bit , int16 DEFAULT_CLOCK_RATE);
static int NI845_ReStart(int32 Is10Bit,uInt16 DEFAULT_CLOCK_RATE);
static int NI845_SetAddress(int32 Is10Bit , uInt16 SlaveAddr);
static int NI845_Read(int8 Command, uInt32 ByteToRead);
static int NI845_Write(unsigned char TransportDataArray[] ,_
uInt32 ByteToWrite , unsigned char ReceiverDataArray[], uInt32 ByteToRead);
//這一行有問題
};
}
前面四個在VB打入類別名稱後 都可以看到它的方法
第五個是消失的 我打入第五個後 它就會寫
'NI845_Write' 含有一個不支援的傳回型別或多個不支援的參數型別。
我把那兩個陣列拿掉 它就變正常了
--
"◢██◣ 呼呼呼~ 為什麼…我這麼愛你…
↙操B跑車 " ,█◥◥◥ ˊ 對不起,他有車。 ˋ ◢██◣
▄◣ ◤ ◎ ◎ ◣◢██◣ˊ █◥◥◥▌
◣◥◣ ◥ ▼◤ ▉█◥◥◥ ◤ ▇ ▇◤
██████ ◣ ╲██◣ ▉◤ ▄ ▄ ◥ █▲◤
██◤▄◥█▃ ◢ █▃●╲ ◤╲█"█◤ g121630作 ◢ ◣ ◣
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 114.42.131.6
→
10/12 22:54, , 1F
10/12 22:54, 1F
→
10/12 22:55, , 2F
10/12 22:55, 2F
推
10/12 23:43, , 3F
10/12 23:43, 3F
→
10/12 23:43, , 4F
10/12 23:43, 4F
→
10/13 00:01, , 5F
10/13 00:01, 5F
推
10/13 00:04, , 6F
10/13 00:04, 6F
→
10/16 15:25, , 7F
10/16 15:25, 7F