PDA

View Full Version : Opening a txt file


Aymen++
07-28-2005, 06:12 AM
i wanna view the contents of a specified txt file when the user clicks on a button in VC++...
how to do that???

aman
07-28-2005, 10:45 AM
Ok well it's easy to do but not exactly that easy.

VC++ is not what a user clicks on a button in. You create an application with VC++ IDE in which you can create a GUI such as a dialog based program. On the dialog, you would place a button and associate it with a ON_BNCLICKED handler. In your message handler, you write the code that opens a file and does something with it. You will need something else in your dialog to display the file, such as a CEdit control for example.

It will be a different procedure if you are creating a SDI or MDI (non dialog based) application. You should complete the Scribble tutorial found at the MSDN website, and you will have enough experience to create a simple project such as this.

Aymen++
07-28-2005, 11:29 AM
can u tell me how to do it? i wanna put a rich text box in the dialog that will be displayed when the user clicks the button...

tboss132
07-28-2005, 02:30 PM
You should complete the Scribble tutorial found at the MSDN website, and you will have enough experience to create a simple project such as this
Have you tried what aman posted above?