initMessageEvent method
Initializes a new cross-document message (XDM) event that the IDocumentEvent::createEvent method created.
![]() ![]() |
Syntax
HRESULT retVal = object.initMessageEvent(eventType, canBubble, cancelable, data, origin, lastEventId, source);
Parameters
- eventType [in]
-
Type: BSTR
One of the following values, or a user-defined custom event type:
-
An HTMLWindowEvents3::onmessage event.
- canBubble [in]
-
Type: VARIANT_BOOL
- cancelable [in]
-
Type: VARIANT_BOOL
- data [in]
-
Type: BSTR
The cross-document message. This value is returned as the IDOMMessageEvent::data attribute of the event.
- origin [in]
-
Type: BSTR
The originating domain of the message. This value is returned as the IDOMMessageEvent::origin attribute of the event.
- lastEventId [in]
-
Type: BSTR
Not used. Set this parameter to an empty string.
- source [in]
-
Type: IHTMLWindow2
A reference to the window that generated the event. This value is returned as the IDOMMessageEvent::source attribute of the event.
Return value
Type: HRESULT
If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
Standards information
Remarks
The lastEventId parameter emulates server-initiated messages, which Windows Internet Explorer 9 does not support.

