I have an ActiveX control embedded in a view. I would like to know if there is a way to get a pointer to the main application window from within the control. Of course, I could get the pointer when creating the control and pass it as an argument of some SetMainWnd method, but I am just curious if there's a direct way - just like AfxGetMainWnd() which unfortunately doesn't work inside the ActiveX control (it returns NULL).