我正在尝试将 a 转换char*
为 a BSTR*
,并且其中char*
包含特殊字符以防止被加密。我尝试了几种在网上找到的方法,但是在调用 vb 代码时,我总是得到不同的结果。我很确定这与特殊字符有关,因为如果我没有它们,它似乎没问题....
我的代码是这样的......
_export myFunction(BSTR *VBtextin, BSTR *VBpassword, BSTR *VBtextout, FPINT encrypt) {
BSTR password = SysAllocString (*VBpassword);
char* myChar;
myChar = (char*) password //is this ok to cast? it seems to remain the same when i print out.
//then I encrypt the myChar in some function...and want to convert back to BSTR
//i've tried a few ways like below, and some other ways i've seen online...to no avail.
_bstr_t temp(myChar);
SysReAllocString(VBtextout, myChar);
任何帮助将不胜感激!!!
谢谢!!!!