in reply to in/out Win32:Ole strings

I highly suspect that the problem is with your
$obj->GetErrorStr(Variant(VT_I4|VT_BYREF,12345),$errstr);
line, where you had VT_BYREF flag set. This would effectively pass the address of '12345' instead of the value of '12345' into the COM method. By definition your COM method requires an error code passed by value, not by reference.

I suspect that if you change the code to
$obj->GetErrorStr(Variant(VT_I4,12345),$errstr);
then it would work.