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