Solved

OPEN AN EXISTING TXT FILE IN A NEW WINDOW

Posted on 2006-07-20
1
241 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 250 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

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

738 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