I have an automation object that takes a BSTR and truncates the string to an arbitrary length. When I call it from C++ it cuts the string. When I call it from vbscript the object cuts the string that it is given but vbscript never sees the change. Is there a rule about this ?
Dim Str
Dim Cutter
Str = "To be or not to be vb"
set Cutter = CreateObject ("Cooler.Class"
if not IsObject(Cutter) then
WScript.Echo("No Cooler.Class Found"
WScript.Quit()
else
WScript.Echo("Cutter Okay"
end if
Cutter.MaxLength = 5
Cutter.Truncate2(Str)
-----------------------------------------------------
interface IClass : IDispatch
{
[id(1), helpstring("method Truncate"] HRESULT Truncate([in, out, ptr] BSTR * data);
[propget, id(2), helpstring("property MaxLength"] HRESULT MaxLength([out, retval] long *pVal);
[propput, id(2), helpstring("property MaxLength"] HRESULT MaxLength([in] long newVal);
[id(3), helpstring("method Truncate2"] HRESULT Truncate2([in, out, ptr] BSTR datum);
};
Dim Str
Dim Cutter
Str = "To be or not to be vb"
set Cutter = CreateObject ("Cooler.Class"
if not IsObject(Cutter) then
WScript.Echo("No Cooler.Class Found"
WScript.Quit()
else
WScript.Echo("Cutter Okay"
end if
Cutter.MaxLength = 5
Cutter.Truncate2(Str)
-----------------------------------------------------
interface IClass : IDispatch
{
[id(1), helpstring("method Truncate"] HRESULT Truncate([in, out, ptr] BSTR * data);
[propget, id(2), helpstring("property MaxLength"] HRESULT MaxLength([out, retval] long *pVal);
[propput, id(2), helpstring("property MaxLength"] HRESULT MaxLength([in] long newVal);
[id(3), helpstring("method Truncate2"] HRESULT Truncate2([in, out, ptr] BSTR datum);
};