DLL中导出的C函数
static const char* s_ptr="asdf"
extern "C" _declspec (dllexport) char* TestString(char** ppChar, int* plen) {
wchar_t wp[] = {L"测试中文啊aahahah哈哈哈"};
static std::string ap = WToX(wp, CP_UTF8);
return (char*)s_ptr;
}
GO加载DLL并获得返回值
package main
lib := syscall.NewLazyDLL("winfunc.dll")
WINDOWS: GO动态调用DLL,并获取字符串返回值的坑
原文:https://www.cnblogs.com/cuidh1983/p/14922485.html