IDesignerProgrammability::IsValidEventName

Checks whether a string represents a valid event name in the host's programming environment.

HRESULT IsValidEventName(
   LPCOLESTR pszEvent
);

Parameter

pszEvent

[in] Pointer to a zero-terminated string.

Return Values

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

Return Value Meaning
S_OK The string represents a valid event name in the host's programming environment.
S_FALSE The string does not represent a valid event name in the host's programming environment.

Comments

The IsValidEventName method checks whether the input string pszEvent represents a valid event name in the host's programming environment. Designers should use this method to ensure that named events will be valid across multiple programming environments and in multiple programming languages.

Example

The following example queries for the SDesignerProgrammability service, then calls its IsValidEventName method to ensure that the string in bstrEventName is a valid identifier.

hr = pServiceProvider->QueryService(SID_DesignerProgrammability,
   IID_IDesignerProgrammability, (void **)&m_piDesignerProgrammability);
if (FAILED(hr)) return;
hr = m_pIDesignerProgrammability->IsValidEventName(bstrEventName);
if (FAILED (hr)) return;