PTT
Submit
Submit
選擇語言
正體中文
简体中文
PTT
C_and_CPP
[問題] C++的DLL回傳structre ref問題
作者:
jerelee
2015-07-01 22:13:37
開發平台(Platform): (Ex: VC++, GCC, Linux, ...)
Eclipse
額外使用到的函數庫(Library Used): (Ex: OpenGL, ...)
sqlite3
問題(Question):
C++'s DLL 內設定回傳reference structure時會出現
str_output11.str_output0=1.0;//debug到這行,出錯exe己經停止運作
麻煩大家幫我看看,謝謝
餵入的資料(Input):
預期的正確結果(Expected Output):
可回傳reference structure
錯誤結果(Wrong Output):
出錯exe己經停止運作
程式碼(Code):請善用置底文網頁, 記得排版)
C++程式碼(DLL)
http://paste.plurk.com/show/2197276/
C程式碼(call C++'s DLL)
http://paste.plurk.com/show/2197281/
補充說明(Supplement):
作者:
jerelee
2015-07-02 01:10:00
如果是用return就ok,用reference就回出錯
作者:
scwg
( )
2015-07-02 04:58:00
http://stackoverflow.com/questions/1906000
1. .c 第三個參數改成 Toutputs *, &str_outputs2. 不保證行為3. 參考 Roger Pate 的回答, 寫個 wrapper
作者:
jerelee
2015-07-02 08:53:00
請問第一點在C加1上Toutputs *, &str_outputs會無法compiler第三點wrapper可否麻煩說明一下,謝謝~
作者: firose (guest也是也是也是也是也)
2015-07-02 12:42:00
不論如何,你的 lpfnDllFunc 第三個參數就跟實際不同了。GetProcAddress 只是去輸出表找函數名,不會幫忙檢查這些
作者:
jerelee
2015-07-02 14:07:00
請問第三個參數要如何定義及使用,感謝
作者: WPC001 (好悶, 迷惘~~)
2015-07-02 22:25:00
AAA是錯的...AAA應該要跟DLL內的簽名相同, 只是改成func ptr
繼續閱讀
[問題] if條件
mater2004
[問題] SERVER問題
Gary12345z
[問題] 全緩衝 and 行緩衝
yshihyu
[問題] 似乎是編譯最佳化?
blackcatevil
[問題] Apriori演算法觀念問題-(L2到C3)
storm654321
[問題] 請問VB.net call C++'s DLL問題
jerelee
Re: [問題] while(*s++ = *t++ );疑問
bdvstg
Re: [問題] while(*s++ = *t++ );疑問
suhorng
[問題] map要怎麼從後面搜尋回來?
ykes60513
[問題] while(*s++ = *t++ );疑問
BitTorrent
Links
booklink
Contact Us: admin [ a t ] ucptt.com