BSTR newID_x = SysAllocString(L"newID");
BSTR newX_x = SysAllocString(L"newX");
functionA(&newID_x);
//Func A does some operation on newID_x, we have that value in newID_x now
functionA(&newX_x);
//After Func A is called for the second time, both newID_x and newX_x become the same
//i.e, both are pointing to same locations and hence values too
私の質問は、それは s の正しい動作ですか?最初に呼び出した後、新しいものBSTR
を保存する必要がありますか?newX_x
BSTR
functionA
またはfunctionA
、渡された s の割り当て/割り当て解除が間違っている可能性があることの一部が間違っていBSTR
ます。