다음을 통해 공유


_U_MENUorID Class

This class provides wrappers for CreateWindow and CreateWindowEx.

class _U_MENUorID

Remarks

This argument adapter class allows either IDs (UINTs) or menu handles (HMENUs) to be passed to a function without requiring an explicit cast on the part of the caller.

This class is designed for implementing wrappers to the Windows API, particularly the CreateWindow and CreateWindowEx functions, both of which accept an HMENU argument that may be a child window identifier (UINT) rather than a menu handle. For example, you can see this class in use as a parameter to CWindowImpl::Create.

The class defines two constructor overloads: one accepts a UINT argument and the other accepts an HMENU argument. The UINT argument is just cast to an HMENU in the constructor and the result stored in the class's single data member, m_hMenu. The argument to the HMENU constructor is stored directly without conversion.

Requirements

Header: atlwin.h

See Also

Concepts

_U_MENUorID Members

ATL Class Overview