473,385 Members | 1,912 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

opening a file

Hello every one,

Can any one tell me the syntax for opening and closing a file in
associated program from C++.
For an instance I got a MS word file. How can I open it in MS word
from a console program in C++. and also how can I close any
application from the console program ( like closing MS word opened in
previous step).

I'm using Visual Studio 2005.

thanks

Jul 23 '07 #1
6 2002
nikhil wrote:
Hello every one,

Can any one tell me the syntax for opening and closing a file in
associated program from C++.
[ ... ]

What makes you think a C++ question is topical in a C group?

Post to news:comp.lang.c++

Jul 23 '07 #2
santosh wrote:
>
nikhil wrote:
Hello every one,

Can any one tell me the syntax for opening and closing a file in
associated program from C++.

[ ... ]

What makes you think a C++ question is topical in a C group?

Post to news:comp.lang.c++
Given that he doesn't want to open the file in his program, but rather
how to get the "associated program" (ie: MS-Word in his case) to open
and close it, I doubt that clc++ is the right place, either. This is
clear by the unquoted part of the OP:
For an instance I got a MS word file. How can I open it in MS word
from a console program in C++. and also how can I close any
application from the console program ( like closing MS word opened in
previous step).
The right place would be one of the Windows-specific groups, but I
don't know which one.

--
+-------------------------+--------------------+-----------------------+
| Kenneth J. Brody | www.hvcomputer.com | #include |
| kenbrody/at\spamcop.net | www.fptech.com | <std_disclaimer.h|
+-------------------------+--------------------+-----------------------+
Don't e-mail me at: <mailto:Th*************@gmail.com>

Jul 23 '07 #3
santosh wrote:
nikhil wrote:
Hello every one,

Can any one tell me the syntax for opening and closing a file in
associated program from C++.

[ ... ]

What makes you think a C++ question is topical in a C group?

Post to news:comp.lang.c++

Geez. Don't send him to clc++ with all that non-standard crap.


Brian
Jul 23 '07 #4
On Jul 23, 12:12 pm, nikhil <rathod.nik...@gmail.comwrote:
Hello every one,

Can any one tell me the syntax for opening and closing a file in
associated program from C++.
For an instance I got a MS word file. How can I open it in MS word
from a console program in C++. and also how can I close any
application from the console program ( like closing MS word opened in
previous step).

I'm using Visual Studio 2005.
Your answer is somewhere in the news:microsoft.public.* area.
Your question is about OLE Automation.
Happy hunting.

Jul 23 '07 #5
On Jul 23, 3:32 pm, user923005 <dcor...@connx.comwrote:
On Jul 23, 12:12 pm, nikhil <rathod.nik...@gmail.comwrote:
Hello every one,
Can any one tell me the syntax for opening and closing a file in
associated program from C++.
For an instance I got a MS word file. How can I open it in MS word
from a console program in C++. and also how can I close any
application from the console program ( like closing MS word opened in
previous step).
I'm using Visual Studio 2005.

Your answer is somewhere in the news:microsoft.public.* area.
Your question is about OLE Automation.
Happy hunting.
thanks guys for helping me out,
by the way I posted this question here,as my question was for both C/C+
+, I'm sorry I forgot to mention c above.

Jul 23 '07 #6
Michael B Allen <io****@gmail.comwrites:
On Mon, 23 Jul 2007 14:01:18 -0700
Ben Pfaff <bl*@cs.stanford.eduwrote:
>POSIX is standardizing an extended set of locale functions with
what you call "context objects". It appears to me to be
implementable as a set of wrappers around the existing functions
for systems that don't support it, so this may actually be a
viable interface fairly soon. (For folks who are familiar with
gnulib--which is not c.l.c compliant code by any means--I'm
thinking about adding a module to support these new functions.)

Glad to hear it. Can you have pointers to info about what the API will
look like?
http://www.opengroup.org/pubs/catalog/c065.htm
--
Ben Pfaff
http://benpfaff.org
Jul 23 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: PM | last post by:
Has anyone found a way to open a file exclusively where it will fail if the file is already open, i have tried the following _FileStream = new FileStream(@"C:\Data.txt", FileMode.Open,...
1
by: Alfons | last post by:
Hello, I have build a program that can do file transferring between a Windows XP computer and a DOS computer via a serial port. The Windows program I have build in C++ with Visual Studio 6.0....
14
by: D. Alvarado | last post by:
Hello, I am trying to open a window containing an image and I would like the image to be flush against the window -- i.e. have no padding or border. Can I make this happen with a single call to a...
5
by: Brad | last post by:
In several aspx applications I export crytal reports to pdf, xls and doc files and then the aspx page writes the selected export file to the client browser. This all works with one small quirk: ...
11
by: aldrin | last post by:
I'm trying to run this code under windows xp sp2 using codeblocks v1.0 compiler with great difficulty.There is no problem with running this under KDevelop in linux. Any help would be greatly...
2
by: Craig | last post by:
Hi there, I'm trying to open colour BMPs using PIL and I'm getting the following errors. Opening a 16 colour BMP I get: Traceback (most recent call last): File "<pyshell#3>", line 1, in...
9
compman9902
by: compman9902 | last post by:
Hello, and thank toy for reading this post. Thus far, this website has helped me a lot, (I have finally finished my encryptor: "site removed by moderator", go to the downloads link) and I will...
15
by: Umesh | last post by:
how to open a website like yahoo.com and use it as input? The following code doesn't work. #include"stdio.h" int main() { FILE *f; f=fopen("http://www.yahoo.com","r"); if(f==NULL)
1
by: Sanjeeva K kanakam | last post by:
Hi all, I am developing one application. In that i have created on report file which contains tables, titles and tree view list also by using HTML tags. I am opening this file in my application it...
34
by: Alexnb | last post by:
Gerhard Häring wrote: No, it didn't work, but it gave me some interesting feedback when I ran it in the shell. Heres what it told me: Traceback (most recent call last): File...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.