# Re: VB如何Call 用VC++写好的dll 档??麻烦指教一下

Posted by 黄牛 on August 09, 1999 at 14:09:38:

In Reply to: Re: VB如何Call 用VC++写好的dll 档??麻烦指教一下 posted by 小琳 on July 20, 1999 at 20:47:12:

我也有相同的问题，
我呼叫 VC++ 写的 dll 档，会有下列错误讯息
执行阶段错误 '49':
DLL 呼叫规格错误
我的 DLL 部份程式码如下
...
float gdata=0;
...
CExchangeDataApp theApp;
extern "C" _declspec(dllexport) void SetExchangeData(float test)
{
gdata=test;
return;
}
extern "C" _declspec(dllexport) float GetExchangeData()
{
return gdata;
}
我的 VB 程式码如下
Private Declare Sub SetExchangeData Lib "ExchangeData" (gdata As Single)

Private Sub Command1_Click()
Dim aa As Single
aa = 1.1
SetExchangeData (aa)
End Sub
烦请高手赐教，谢谢

Follow Ups: