You Have A Net Control Hosted In Internet Explorer 8 And It Restarts A Tab In Internet Explorer
- 01 Apr 2009
<?xml:namespace prefix = o ns = “urn:schemas-microsoft-com:office:office” />
The reasons for this include that you did not implement the IObjectSafety Interface properly. You must use the PreserveSig attribute in this interface definition:</font></p>
<span style="FONT-SIZE: 10pt; mso-ansi-language: EN" lang=EN>[ComImport]</span>
[Guid("CB5BDC81-93C1-11CF-8F20-00805F2CD064")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
interface IObjectSafety
{
[PreserveSig]
int GetInterfaceSafetyOptions(ref Guid riid, out int pdwSupportedOptions, out int pdwEnabledOptions);
[PreserveSig]
int SetInterfaceSafetyOptions(ref Guid riid, int dwOptionSetMask, int dwEnabledOptions);
}
<font size=3 face=Calibri>The reason your control may work in IE7 fine and stop working in IE8 without the PreserveSig attribute is because the older code is compiled different. IE8 is using Stack objects and indexed on ESP. The incorrect method definition for the interface unbalances the stack and ESP is off and this causes the underlying AV that results in this message.</font>
<font size=3 face=Calibri>Fix your code to implement the Interface correctly and this will fix the problem.</font>
`</p>
</font>`</span>
<< Go Back