E*****7 发帖数: 128 | 1 有一个C++函数因为其涉及到Open MP而不能用C#直接写(C#目前不能支持Open MP)。想
先把该函数编译成Manged Application上的DLL,然后在C#里面调用。有那位知道该如何
实现?谢谢! |
x****u 发帖数: 44466 | 2 参见C#直接调用win api,都一样的。
【在 E*****7 的大作中提到】 : 有一个C++函数因为其涉及到Open MP而不能用C#直接写(C#目前不能支持Open MP)。想 : 先把该函数编译成Manged Application上的DLL,然后在C#里面调用。有那位知道该如何 : 实现?谢谢!
|
k***r 发帖数: 4260 | |
s******n 发帖数: 21 | 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?
|
P********e 发帖数: 2610 | 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.
|
s******n 发帖数: 21 | 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.
|