IVBGetControl::EnumControls method (vbinterf.h)
Enumerates the controls on the form.
Syntax
HRESULT EnumControls(
[in] DWORD dwOleContF,
[in] DWORD dwWhich,
[out] LPENUMUNKNOWN *ppenumUnk
);
Parameters
[in] dwOleContF
Specifies the type of OLE objects to be enumerated. This parameter can be one of the following values enumerated by the OLECONTF enumeration.
When enumerating OLE controls, it is recommended that you combine the flags OLECONTF_ONLYUSER, OLECONTF_ONLYIFRUNNING, and OLECONTF_EMBEDDINGS. To include both OLE controls and VBX controls, add the OLECONTF_OTHERS flag to this list. To enumerate only VBX controls, remove the OLECONTF_EMBEDDINGS flag and include the OLECONTF_OTHERS flag.
[in] dwWhich
Specifies the set of controls to be enumerated. This parameter can be one of the following values.
Use one of the flags GC_WCH_SIBLING, GC_WCH_CONTAINER, GC_WCH_CONTAINED, or GC_WCH_ALL in combination with any of the GC_WCH_Fxxx flags.
In VBX code, the GC_FORM flag was passed to VBGetControl to obtain a pointer to the form. In OLE control code, there is no direct replacement for this flag. Instead, pass GC_WHC_ALL to EnumControls and use the pointer to the first control in the enumeration. The first control in the enumeration is always the form when using GC_WHC_ALL.
[out] ppenumUnk
Pointer to an enumeration of OLE objects.
Return value
This method supports the standard return values E_INVALIDARG, E_OUTOFMEMORY, and E_UNEXPECTED, as well as the following:
Remarks
When migrating a VBX control to an OLE control, EnumControls replaces the Visual Basic VBGetControl, which is no longer supported.
Requirements
Requirement | Value |
---|---|
Target Platform | Windows |
Header | vbinterf.h |