Solved

remove Document from MDI.

Posted on 2002-05-29
3
288 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
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.
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

691 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