Redian新闻
>
C#程序调用Windows C++ DLL的问题
avatar
C#程序调用Windows C++ DLL的问题# Programming - 葵花宝典
E*7
1
有一个C++函数因为其涉及到Open MP而不能用C#直接写(C#目前不能支持Open MP)。想
先把该函数编译成Manged Application上的DLL,然后在C#里面调用。有那位知道该如何
实现?谢谢!
avatar
x*u
2
参见C#直接调用win api,都一样的。

【在 E*****7 的大作中提到】
: 有一个C++函数因为其涉及到Open MP而不能用C#直接写(C#目前不能支持Open MP)。想
: 先把该函数编译成Manged Application上的DLL,然后在C#里面调用。有那位知道该如何
: 实现?谢谢!

avatar
k*r
3
P/Invoke?
avatar
s*n
4
There are 3 ways I can think of: P/Invoke, C++/CLI wrapper and COM wrapper.
My impression is that C++/CLI wrapper perform much better than P/Invoke
but the it's a pain on the ass to write especially for beginners.
If you know COM well, this is another way to go.

【在 k***r 的大作中提到】
: P/Invoke?
avatar
P*e
5
__declspec( dllimport )
这种算com 还是c++/cli wrapper

wrapper.

【在 s******n 的大作中提到】
: There are 3 ways I can think of: P/Invoke, C++/CLI wrapper and COM wrapper.
: My impression is that C++/CLI wrapper perform much better than P/Invoke
: but the it's a pain on the ass to write especially for beginners.
: If you know COM well, this is another way to go.

avatar
s*n
6
Not quite understand your question... I was talking aout calling into
unmanaged(native) dlls from managed applications (.NET). I believe __
declspec( dllimport ) is a native C++ only attribute.

【在 P********e 的大作中提到】
: __declspec( dllimport )
: 这种算com 还是c++/cli wrapper
:
: wrapper.

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。