[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

remove Document from MDI.

Posted on 2002-05-29
3
Medium Priority
?
290 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 400 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

656 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