vb调用vc dll返回字符串类型

前端之家收集整理的这篇文章主要介绍了vb调用vc dll返回字符串类型前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

VC++

.h

_declspec(dllexport) void __stdcall Stringdccode(char * lhcode,char * lhdecode);

.cpp

void __stdcall Stringdccode(char * lhcode,char * lhdecode){
Base64 bs;
LPCTSTR stringcodet = lhdecode;
string strDecode = bs.base64_decode(stringcodet);
strcpy(lhcode,strDecode.c_str());
}

VB调用

Private Declare Sub Stringdccode Lib "FileCode.dll" (ByVal lhcodes As String,ByVal lhdecode As String)

Dim s As String s = String(255,Chr(0)) Stringdccode s,"suLK1Gh0dHA6Ly8xOTIuMTY4LjAuMTgwOjgwODAvaHAucGRmL7rOxfSy4srU" '' Debug.Print Left$(s,InStr(s,Chr(0)))

原文链接:https://www.f2er.com/vb/262924.html

猜你在找的VB相关文章