[問題] VC++2010的.def檔
開發平台(Platform): (Ex: VC++, GCC, Linux, ...)
VC++2010
額外使用到的函數庫(Library Used): (Ex: OpenGL, ...)
基本上好像沒有
問題(Question):
小弟想做個excel可用之dll檔,不過依網路上教學,卻發現在準備於
source files加入.def檔時,這檔並不存在於VC++2010中,
所以教學書上的做法卡關;網路上有文章說可以自己把.cpp檔改.def
照做之後跑build solution得到.dll檔在Excel中仍無法使用。
餵入的資料(Input):
一般的輸字,1或5之類整數
預期的正確結果(Expected Output):
輸入值之平方
錯誤結果(Wrong Output):
#Value!
程式碼(Code):(請善用置底文網頁, 記得排版)
square.cpp頁
double __stdcall square_in_C(double &arg){return (arg*arg);}
square.def頁
LIBRARY MyXLLib
EXPORTS
square_in_C
vba的module頁
Declare Function square_in_C _
Lib "C:/Visual Studio 2010/Projects/MyXLLib/Debug/MyXLLib.dll" _
(arg As Double) As Double
補充說明(Supplement):
參考教學文件叫
A brief introduction to C++ and Interfacing with Excel
先謝謝大家!
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 111.254.131.46
推
06/05 12:08, , 1F
06/05 12:08, 1F
→
06/05 12:08, , 2F
06/05 12:08, 2F
→
06/05 18:59, , 3F
06/05 18:59, 3F
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章