Hi everyone,

I've written a class and put a COM wrapper around it. The class (and COM) takes a BSTR as an input parameter which is modified and then sent back out to whatever called the COM. I've declared the BSTR as [in, out] in the IDL and I'm using:

SysReAllocString(&strParameters, (OLECHAR*)chstrParams);

to alter the BSTR strParameters that is the input to the COM. I then have to call delete[] on the char* chstrParams. At this point the BSTR still appears to be valid, but when the COM exits I get an unhandled exception error. Am I dealing with returning the altered BSTR correctly and the re-allocation of the string?

Thanks for your help.