我用如下代码制按钮类:
class CAtlButton: public CWindowImpl<CAtlButton,CWindow>
{
public:
    DECLARE_WND_CLASS(_T("BUTTON"))    BEGIN_MSG_MAP(CMyWindow)
        CHAIN_MSG_MAP(CAtlButton)
    END_MSG_MAP()

HWND Create(HWND hwndparent,int nx,int ny,int nwidth,int nheight, DWORD dwStyle)
{
int nStyle=dwStyle;
if ((nStyle & WS_CHILD)==false)
nStyle|=WS_CHILD;
HWND hWnd=::CreateWindow("BUTTON",NULL,nStyle,nx,ny,nwidth,nheight,hwndparent,NULL,NULL,NULL);
this->SubclassWindow(hWnd);
ATLASSERT(m_hWnd==hWnd);
return hWnd;
}
};当我在主窗口OnCreate中用以下方法建立按钮时:
    LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
    {
        CAtlButton button1;
        button1.Create(m_hWnd,0,0,60,20,WS_VISIBLE);
        return 0;
    }
程序就会出现问题请问在WTL中究竟怎么建立按钮类,请求高人指教,在下先表示谢了!