MFC SDI application without a standard “new document” at startup

My application is an SDI with several views. By default, it creates a new document when the application starts. I want to change this behavior so that a new document is created only when the user explicitly clicks on "Create". Or at least mimic this behavior. Any ideas? I am using Visual Studio 2008 with the MFC Feature Pack. I googled and found some solution to this problem in an old MS journal article . But, unfortunately, this does not work now. Any workarounds or solutions? In short, I need to distinguish between calling a frame in OnFileNew () and the user Click on New.

+3
source share
1 answer

Are you sure the frame is triggering OnFileNew? If so, set a breakpoint in the function, then track it to where it was called. If necessary, redefine the function that calls it, and do the same except creating a new document. That should do it.

+1
source

Source: https://habr.com/ru/post/1741861/


All Articles