vc的Sample.cpp
int __stdcall fun(雙a,雙b,雙* res)
{
RES[0]= a+b;
RES[1]= a-b;
RES[2]= a * b;
RES[3]= a/b;
返回0;
}
vc的樣本定義
出口
樂趣
vb:
聲明子fun庫“sample . dll”(byval a為double,byval b為double,byref x為double)
私有子命令1_click()
dim x(4)為雙精度
fun 1,2,x(0)
text1.text = x(0)
text2.text = x(1)
text3.text = x(2)
text4.text = x(3)
末端接頭
在上面的例子中,將數組的第壹個元素傳遞給dll可以把東西作為返回值帶回來。