0
我試圖將char*
轉換爲BSTR*
,並且我的char*
中的特殊字符被加密。我嘗試了幾種在網上找到的方法,但回到調用vb代碼中,我總是會得到一些不同的結果。我敢肯定,這與特殊字符做,因爲如果我沒有他們,這似乎是確定....將char *轉換爲包含特殊字符的BSTR *
我的代碼是沿着這些路線的東西...
_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);
任何幫助將非常感謝!
謝謝!
你究竟在做什麼?您是否試圖將VB與C代碼連接? – thkala 2011-04-20 20:47:35
是......正好...... VB代碼調用C代碼......然後回到VB代碼。 – George 2011-04-20 20:50:10
你有沒有得到這個問題的解決方案? – 2012-03-13 11:14:11