We found that in the process are two ways to solve the problem: dll unmanaged C ++ library one kind created, you need to call a static method. This method can not be directly referenced in the C # reference, but rather to use a static method call, the other blog has been described in great detail, the only need to add that, C # file you need to:
using
System.Runtime.InteropServices;
Before you can call [DllImport] method.
Another method is to directly using CLR, managed to generate C ++ dll library.
Create a process
routine as
C ++ dll:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
|
C # Language:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
|
These are the contents of C # to call C ++ dynamic link library dll's, please pay attention to more details PHP Chinese network (www.php.cn)!