Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

OPEN AN EXISTING TXT FILE IN A NEW WINDOW

Posted on 2006-07-20
1
Medium Priority
?
245 Views
Last Modified: 2012-05-05
hi experts,
I have a win32 application project . I want when I push a button to open a new window including an existing txt file.I want this window to have the default menu(which is created when we create a window application(file,state,.... ).If you can send me the code.Thank you
0
Comment
Question by:geomvigla
[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
1 Comment
 
LVL 15

Accepted Solution

by:
lakshman_ce earned 1000 total points
ID: 17145732
1. Create a MFC AppWizard(exe)/ MFC Application based project
2. In the Application Settings select Single Document

This will bring you the default menu.
3. Add a dialog and class for that dialog , say CTextReader
4. You can handle the command events for the toolbar menu that appears by default instead of new button. For example you can use the File->New menu or 'New' toolbar button.
5. Go to the classwizard for the mainframe and add a event handler for the item ID_FILE_NEW
and add the following code to  pop up the dialog on the 'New' button click
void CMainFrame::OnFileNew()
{
      // TODO: Add your command handler code here
      CTextReader *pDialog = new CTextReader();
      BOOL ret = pDialog->Create(IDD_DIALOG1,this);
    pDialog->ShowWindow(SW_SHOW);

      
}

6.Refer to this for opening existing file and showing it on the dialog
http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/VisualC_PLUS_PLUS_DOT_NET/Q_21911253.html
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

The following diagram presents a diamond class hierarchy: As depicted, diamond inheritance denotes when two classes (e.g., CDerived1 and CDerived2), separately extending a common base class (e.g., CBase), are sub classed simultaneously by a fourt…
In Easy String Encryption Using CryptoAPI in C++ (http://www.experts-exchange.com/viewArticle.jsp?aid=1193) I described how to encrypt text and recommended that the encrypted text be stored as a series of hexadecimal digits -- because cyphertext may…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

721 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