Re: Thread apartment IE7



Cedric Scheyder <cedric.scheyder@xxxxxxxxxxxxxxxxx> wrote:
hr = iElem->put_value(T2OLE(sValue));

put_value expects a BSTR. T2OLE does not produce one. You see, while any
BSTR can be treated as LPOLESTR, not every LPOLESTR can be treated as a
BSTR. A BSTR must be allocated with SysAllocString or similar.

Make it

hr = iElem->put_value(CComBSTR(sValue));

Also, if by any chance you are trying to do this to <input type="file">,
it's not going to work: value property is read-only for this control,
for security reasons.
--
With best wishes,
Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925


.


Loading