PRB: Events Not Working for COM Objects in HTML Page (253668)



The information in this article applies to:

  • Microsoft Internet Explorer (Programming) 5
  • Microsoft Internet Explorer (Programming) 5.01
  • Microsoft Internet Explorer (Programming) 5.5

This article was previously published under Q253668

SUMMARY

When using the OBJECT tag to add a COM object to a Web page, the event handlers may not work correctly. In some extreme cases, the object may intermittently fail to create.

CAUSE

The syntax for the CLASSID attribute is specified incorrectly.

RESOLUTION

To resolve this problem, correct the CLASSID attribute syntax. Specifically, insure that the OBJECT tag has the form:
<OBJECT CLASSID="clsid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" ...>
				
Note that there are no parentheses surrounding the control CLSID.

MORE INFORMATION

When an incorrect syntax for the CLSID is specified using parentheses around the CLSID, the object may still be created, though in an unsupported fashion. When this happens, the HTML engine is unable to obtain enough information to connect events from simple objects, such as those created with the ATL Object Wizard as "ATL simple objects."

Adding support for IPersist and IProvideClassInfo2 to the simple COM object will alleviate the event handling problems, but the correct solution is to correct the bad CLASSID syntax in the HTML page. There is no guarantee that this illegal syntax will work at all in future versions of Internet Explorer.

STATUS

This behavior is by design.

Modification Type:MajorLast Reviewed:5/12/2003
Keywords:kbprb KB253668