Re: corrupt IE
From: Peter Carlson (peter_at___N.O.S.P.A.M__howudodat.com)
Date: 02/22/05
- Next message: Louis Solomon [SteelBytes]: "CommitUrlCacheEntry returning ERROR_DISK_FULL"
- Previous message: D Devlin: "Re: corrupt IE"
- In reply to: D Devlin: "Re: corrupt IE"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 21 Feb 2005 21:41:14 -0700
I'll play with that, however the offending line is document->write so it
never gets to SafeArrayDestroy();
-p
"D Devlin" <valid@email.address> wrote in message
news:e$lN4XIGFHA.1188@tk2msftngp13.phx.gbl...
> Make sure you are not double releasing the data you
> are writing to the browser. SafeArrayDestroy() calls
> VariantClear() on each member of the array, including
> calling SysFreeString() on BSTRs.
>
> Try changing:
>
> param->bstrVal = (BSTR)msg;
>
> to:
>
> param->bstrVal = SysAllocString(msg);
>
> or a similar CComBSTR method. This way when the
> referenced CComBSTR (msg) goes out of scope, it
> does not attempt to free data already released.
>
>
> Darron
>
>
>
>
>
> "Peter Carlson" <peter@__N.O.S.P.A.M__howudodat.com> wrote in message
> news:%23G%233MPHGFHA.4072@TK2MSFTNGP10.phx.gbl...
> > We have had a slew of problems with possibly corrupt IE installs?!? We
> use
> > a hosted WBC as a RTF text output. document->write crashes hard.
> Sometimes
> > an access violation, sometimes just exits. If we run IEFix from mvps,
or
> > re-install IE it seems to start working. Data is written to the control
> with
> > the following code. Any Ideas? Is there some spyware or other crap
that
> is
> > corrupting IE?
> >
> > USES_CONVERSION;
> > _acp = CP_UTF8;
> > CComBSTR bstr; bstr = T2W(csMessage.GetBuffer());
> > _wndText.Write(bstr);
> > Write() looks like:
> >
> > void Write(CComBSTR &msg) {
> > IHTMLDocument2 *document = GetDoc();
> > if (!document) return;
> > static bool _bReady2Write;
> > if (!_bReady2Write) {
> > CComVariant b(true);
> > CComVariant v;
> > document->open(NULL, v, v, b, NULL);
> > _bReady2Write = true;
> > }
> >
> > HRESULT hresult = S_OK;
> > VARIANT *param;
> > SAFEARRAY *sfArray;
> > sfArray = SafeArrayCreateVector(VT_VARIANT, 0, 1); // Creates a new
> > one-dimensional array
> > if (sfArray == NULL || document == NULL) goto cleanup;
> > hresult = SafeArrayAccessData(sfArray,(LPVOID*) & param);
> > param->vt = VT_BSTR;
> > param->bstrVal = (BSTR)msg;
> > hresult = SafeArrayUnaccessData(sfArray);
> > hresult = document->write(sfArray);
> > cleanup:
> > if (sfArray != NULL) {
> > SafeArrayDestroy(sfArray);
> > document->Release();
> > }
> > }
> >
> >
>
>
- Next message: Louis Solomon [SteelBytes]: "CommitUrlCacheEntry returning ERROR_DISK_FULL"
- Previous message: D Devlin: "Re: corrupt IE"
- In reply to: D Devlin: "Re: corrupt IE"
- Messages sorted by: [ date ] [ thread ]