Normally, the CMainFrame object is constructed in the InitInstance method using the call -
pDocTemplate = new CSingleDocTemplate(
RUNTIME_CLASS(CMainFrame), // main SDI frame window
Do you see this call in InitInstance?
If you don't see this, it means that the construction is being done elsewhere; your app class constructor perhaps.
If you do see the above code and you still have the behavior you mentioned, it could mean that some other CMainFrame instance is being constructed.
Whatever the case, it is not the correct way to do it.
«_Superman_» I love work. It gives me something to do between weekends.