views:

123

answers:

1

My application is an SDI with multiple views. By default, it creates a new document when the application starts. I want to modify this behavior so that a new document is created only when user explicitly clicks on "New". Or at least mimic this behavior. Any ideas? I am using Visual Studio 2008 with MFC feature pack. I googled and found some solution to this problem in an old MS Journal article. But unfortunately it doesn't seem to work now. Any workarounds or solutions? In short, I need to differentiate between framework call to OnFileNew() and User Click on New.

+1  A: 

Are you sure the frame work calls OnFileNew? If so, set a breakpoint in the function then trace back to where its called. If necessary, override the function calling it and do everything the same except the creation of a new document. That should do it.

Goz