-
March 19th, 2009, 11:02 PM
#1
reading a content of a text file
How to write a program to read a content of a text file.
Actually i need to create a front end for a C program.
By clicking a button, it should call the .exe of the c program and displays the output of the program which is present in .txt file.
Can anyone guide me to write this program
-
March 20th, 2009, 01:49 AM
#2
Re: reading a content of a text file
See CreateProcess() Windows API for creating a new process (running your executable). Then, for displaying the text file, well, that depends on the way you want to display it. For instance you can run notepad.exe providing the path as an argument. Or you can display it in your own application. So you have to explain more.
-
March 20th, 2009, 04:28 AM
#3
Re: reading a content of a text file
Thanks for ur reply.I hav some more doubts.
Is it possible to use system command in VC++.
I have to execute/open a command prompt to execute a c file from a button click.
Is it possible to do this using createprocess
-
March 20th, 2009, 04:30 AM
#4
Re: reading a content of a text file
You can't execute a c file. You need to compile it first.
With ShellExecuteEx combined with WaitForSingleObject you can execute a exe file and wait for it to end.
-
March 20th, 2009, 04:51 AM
#5
Re: reading a content of a text file
k...Is it possible atleast to open the exe.
-
March 20th, 2009, 04:54 AM
#6
Re: reading a content of a text file
I hav been asked to execute a C program from VC++ program using buttonclick event.
Is it possible to do this?
-
March 20th, 2009, 05:01 AM
#7
Re: reading a content of a text file
Yes, but it has to be compiled first. The you can run the executable with CreateProcess(). What's not clear?
-
March 20th, 2009, 05:06 AM
#8
Re: reading a content of a text file
K...Is it not possible to compile it in VC++.
How to use CreateProcess in VC++.
-
March 22nd, 2009, 11:27 PM
#9
Re: reading a content of a text file
I hav got the result for this
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|