ICodeNavigate::DisplayDefaultEventHandler

Displays the default event handler for an object.

HRESULT DisplayDefaultEventHandler(
LPSTR lpstrObjectName
);

Parameter

lpstrObjectName

[in] Pointer to the name of an object.

Return Values

The return value obtained from HRESULT is one of the following:

Return Value

Meaning

S_OK

Success.

E_INVALIDARG

One or more of the arguments is invalid.


Comments

The DisplayDefaultEventHandler method causes the default event handler for the named object to be displayed. 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 SCodeNavigate service and calls the DisplayDefaultEventHandler method. The variable pwstr gives the name of the object for which it will display the event handler.

hr = m_pServiceProvider->QueryService(SID_SCodeNavigate, 
                        IID_ICodeNavigate, (void **)&pNavigate);
if (FAILED(hr)) return;

pNavigate->DisplayDefaultEventHandler(pwstr);
pNavigate->Release();