How do i create my own class using AfxRegisterClass in CDialog? For CWnd, i can put the code inside the PreCreateWindow, but for CDialog, the PreCreateWindow function isn't called at all.