Solved

remove Document from MDI.

Posted on 2002-05-29
3
285 Views
Last Modified: 2013-11-20
hi,

i want to remove doc from MDI application.
After create new document , i have to get the handle and close the document.

1. I cannot call the OnCloseDocument() within OnInitialUpdate ( CView ).

2. If I call OnCloseDocument within OnShowWindow ( CView ), document is closing but "Failed to create empty document" error is comming.
 
regards,
raj
0
Comment
Question by:raj_selvam
  • 2
3 Comments
 
LVL 23

Expert Comment

by:Roshan Davis
ID: 7041517
If u don't want to open any document at starting, In YourApp::InitInstance() use the code as below

     CCommandLineInfo cmdInfo;
     ParseCommandLine(cmdInfo);

     //****** NEW LINE ADDED HERE *******
     cmdInfo.m_nShellCommand = CCommandLineInfo::FileNothing;
     //**********************************

     // Dispatch commands specified on the command line
     if (!ProcessShellCommand(cmdInfo))
          return FALSE;


GOOD LUCK
0
 
LVL 23

Accepted Solution

by:
Roshan Davis earned 100 total points
ID: 7041528
Or You can call

GetParent()->PostMessage(WM_CLOSE);

in InitialUpdate of CView

GOOD LUCK
0
 
LVL 1

Author Comment

by:raj_selvam
ID: 7043405
Thanx roshmon,
this is exactly, what i want!!!

regards,
selvam
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Question regarding Copy/Paste 16 96
Folder Comparison 12 54
Tab names are off by one 5 54
how to split multiple lines delimiter : 8 100
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question