将char *转换为包含特殊字符的BSTR *
|
我正在尝试将ѭ0转换为ѭ1,而我的ѭ0却具有特殊字符,无法进行加密。我尝试了在Web上找到的几种方法,但是回到调用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);
任何帮助将不胜感激!
谢谢!!!!
没有找到相关结果
已邀请:
1 个回复
邵酮
。首先进行复制:
如果一切成功,请执行转换。确保适当地处理故障。
然后复制回来:
另外,请阅读Eric的BSTR语义完整指南。