Displays the event handler for a specific event.
HRESULT DisplayEventHandler(
LPCOLESTR lpstrObjectName,
LPCOLESTR lpstrEventName
);
Parameter
lpstrObjectName
[in] Pointer to the name of an object.
lpstrEventName
[in] Pointer to the name of an event.
Return Values
The return value obtained from HRESULT is one of the following:
Return Value | Meaning |
S_OK | Success. |
E_INVALIDARG | One of the arguments is invalid. |
Comments
A designer calls the DisplayEventHandler method to display the event handler for the named event in the named object. The name passed in lpstrEventName specifies the event.
The name passed in lpstrObjectName refers to the property that returns the object. This name appears in the type information for the ActiveX designer. Examples are "Button1" and "Form1."
Example
The following example queries for the ICodeNavigate2 interface in the SCodeNavigate service, then calls the DisplayEventHandler method. The variables pObjectName
and pEventName
specify the object and event for which to display the event handler.
hr = m_pServiceProvider->QueryService(SID_SCodeNavigate,
IID_ICodeNavigate2, (void **)&pNavigate2);
if (FAILED(hr)) return;
pNavigate->DisplayEventHandler(pObjectName, pEventName);
pNavigate->Release();
See Also