본문 바로가기

MFC

MFC 4.x 와 MFC 9.x 의 차이점 (스핀컨트롤 CreateEx)

728x90
반응형
MFC 4.x 에서 코딩할 경우 CSpinButtonCtrl::CreateEx 는 다음과 같이 정의되어 있다.

    BOOL CreateEx(DWORD dwExStyle, LPCTSTR lpszClassName,
        LPCTSTR lpszWindowName, DWORD dwStyle,
        const RECT& rect,
        CWnd* pParentWnd, UINT nID,
        LPVOID lpParam = NULL);

위 정의는 CSpinButtonCtrl 클래스의 부모 클래스인 CWnd 클래스의 멤버함수 정의이다.

MFC 9.x 에서는
CSpinButtonCtrl 의 멤버함수인 CreateEx 를 사용하게 된다.
이 멤버함수의 정의는 다음과 같다.

    // Generic creator allowing extended style bits
    virtual BOOL CreateEx(_In_ DWORD dwExStyle, _In_ DWORD dwStyle, _In_ const RECT& rect,
        _In_ CWnd* pParentWnd, _In_ UINT nID);

굳이 lpszClassName 과 lpszWindowName 파라미터값을 입력하지 않아도 된다.

스핀버튼 컨트롤의 클래스이름은 msctls_updown32 이다.
 
반응형