【发布时间】:2020-10-19 09:01:17
【问题描述】:
我尝试使用 ctypes 在 python 程序上使用 DLL。
这是我想在 python 中使用的 C# 代码和函数的参数:
[DllImport("test.dll", CharSet = CharSet.Auto, CallingConvention = CallingConvention.Cdecl)]
public static extern int function(
byte[] filename,
byte[] name,
IntPtr result,
out IntPtr UnmanagedStringArray,
out int iStringsCountReceiver);
下面的代码是我的python代码。我搜索了几个站点,但找不到有关 argtypes 的提示。 请帮我在python中使用DLL。
mydll = c.cdll.LoadLibrary("test.dll")
func = mydll['function']
func.argtypes=( ....)
【问题讨论】:
-
这能回答你的问题吗? Calling C/C++ from Python?