By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,589 Members | 1,209 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,589 IT Pros & Developers. It's quick & easy.

Open a file in Notepad from VC++ Application

P: n/a
Hi,

I am a total novice to VC++..I have a dialog based application
developed using MFC...my requirement is to open a file (with .dat or
..txt ext) invoking Notepad from my application. The user should be able
to pick the file from the list and then on hit of the Open button it
should open the file in notepad. I am not able to figure out how to
invoke notepad passing the filename from on my OPEN button click.

Nov 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Take a look at ShellExecuteEx(). That should do what you want.

Tom

<pr******@gmail.com> wrote in message
news:11*********************@g47g2000cwa.googlegro ups.com...
Hi,

I am a total novice to VC++..I have a dialog based application
developed using MFC...my requirement is to open a file (with .dat or
.txt ext) invoking Notepad from my application. The user should be able
to pick the file from the list and then on hit of the Open button it
should open the file in notepad. I am not able to figure out how to
invoke notepad passing the filename from on my OPEN button click.

Nov 17 '05 #2

P: n/a

pr******@gmail.com wrote:
*Hi,

I am a total novice to VC++..I have a dialog based application
developed using MFC...my requirement is to open a file (with .dat or
...txt ext) invoking Notepad from my application. The user should be
able
to pick the file from the list and then on hit of the Open button it
should open the file in notepad. I am not able to figure out how to
invoke notepad passing the filename from on my OPEN button click. *


What About using CreateProcess or ShellExecute api

eg

Code:
--------------------

ShellExecute(NULL,"open","notepad.exe","FileName.t xt",NULL,SW_SHOWNORMAL);

--------------------


--
thatsalok
------------------------------------------------------------------------
Posted via http://www.codecomments.com
------------------------------------------------------------------------

Nov 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.