为 const char *
#pragma once
#include
#define PYAPI _declspec(dllexport)
extern "C" {
PYAPI const char* runCapture(char* ip, int port, char* username, char* password, char* channel, int preset, char* type, char* filepath);
}
python
irr = CDLL("./captureWheel_dll.dll")
irr.runCapture.restype = ctypes.c_char_p //定义返回类型
tVersion = irr.runCapture(ip, port, username, password, channel, preset, capturetype, filepath)
s = ""
for i in range(0, len(tVersion)):
s += chr(tVersion[i])
print('version = ', s) # 返回值打印为:( version = 1.0)
print("version = ", (tVersion)) # 返回值打印为:( version = b'1.0')
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)