Jan,

Thanks for the quick turn around and clue on email formats.  I'm a bit new
to this, as you can tell, and I really appreciate your help.  I'm traveling
and do not have access to a C development environment.  Is there somewhere I
can get a PPM version with this fix?

Regards,
Richard

|-----Original Message-----
|From: Jan Dubois [mailto:[EMAIL PROTECTED]
|Sent: Monday, November 28, 2005 7:21 PM
|To: 'Richard Bell'; 'Jan Dubois'; libwin32@perl.org
|Subject: RE: Win32::OLE crashes
|
|On Mon, 28 Nov 2005, Richard Bell wrote:
|> I'm trying to make some enhancements to Win32::IE::Mechanize that
|> involve (in part) blocking popups. Several online examples suggest
|> catching the NewWindow event and setting cancel true. When I attempt
|> to do so I get Win32::OLE crashes. I've included an example program
|> that exhibits the issue on my machines:
|
|Thanks for the report!  This is a bug in Win32::OLE.  Here is a fix:
|
|--- OLE.xs.~1~  Mon Nov 28 16:15:09 2005
|+++ OLE.xs      Mon Nov 28 16:15:09 2005
|@@ -2306,10 +2306,12 @@
|             SysFreeString(*V_BSTRREF(pVariant));
|             break;
|         case VT_DISPATCH:
|-            (*V_DISPATCHREF(pVariant))->Release();
|+            if (*V_DISPATCHREF(pVariant))
|+                (*V_DISPATCHREF(pVariant))->Release();
|             break;
|         case VT_UNKNOWN:
|-            (*V_UNKNOWNREF(pVariant))->Release();
|+            if (*V_UNKNOWNREF(pVariant))
|+                (*V_UNKNOWNREF(pVariant))->Release();
|             break;
|         }
|         VariantInit(pVariant);
|End of Patch.
|
|With the patch applied, the crash goes away and all popups are blocked.
|Of course I first had to disable popup blockers in IE itself, and in the
|Google toolbar before I could even see the problem...
|
|Cheers,
|-Jan
|
|PS: Please don't use HTML email, especially if you include source samples.
|
|



Reply via email to