Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > How to get Notifications when a word doc is modified and closed

Reply
Thread Tools

How to get Notifications when a word doc is modified and closed

 
 
Reji
Guest
Posts: n/a
 
      03-24-2006
Hi All,

I have an MFC dialog based application, where I can browse for files
and open them. For opening files I get the file path and use
ShellExecute(...). But with ShellExecute(...), i lose control over the
process. So I am now using FindExecutable(...) and CreateProcess(...).
Now I am able to wait till the notepad document or similiar ones get
closed. (I am using WaitForSingleObject(processInfo.hProcess,
INFINITE)).


Now I have 2 issues :
1. The same code does not seem to work for word docs. The
WaitForSingleObject(processInfo.hProcess, INFINITE), returns
immediately. It does not wait for the word doc to get closed. But the
same code works for notepad files.


2. Even if I wait, how can I find out if the file has been modified or
not? Basically , I want my MFC application to be notified if the file
that it opened was modified and the changes were
saved by the user. I tried using
GetExitCodeProcess(processInfo.hProcess, &dwExitCode), but will I know
if the file has been modified or not using the dwExitCode?


Please help me with this.


Thanks in advance,
Reji

 
Reply With Quote
 
 
 
 
Ian Collins
Guest
Posts: n/a
 
      03-24-2006
Reji wrote:
> Hi All,
>
> I have an MFC dialog based application, where I can browse for files
> and open them. For opening files I get the file path and use
> ShellExecute(...). But with ShellExecute(...), i lose control over the
> process. So I am now using FindExecutable(...) and CreateProcess(...).
> Now I am able to wait till the notepad document or similiar ones get
> closed. (I am using WaitForSingleObject(processInfo.hProcess,
> INFINITE)).
>

You will have better luck on a windows programming group, this isn't a
C++ issue.


--
Ian Collins.
 
Reply With Quote
 
 
 
 
Reji
Guest
Posts: n/a
 
      03-24-2006
Thanks Ian, But can i not use CreateProcess() and WaitForSingleObject
in a noraml C++ program? Forget the MFC application. How can I do it in
a C++ application?

Thanks in advance,
Reji

 
Reply With Quote
 
Ian Collins
Guest
Posts: n/a
 
      03-24-2006
Reji wrote:
> Thanks Ian, But can i not use CreateProcess() and WaitForSingleObject
> in a noraml C++ program? Forget the MFC application. How can I do it in
> a C++ application?
>

I believe so, but they are windows functions, not part of standard C++.

--
Ian Collins.
 
Reply With Quote
 
jimmy
Guest
Posts: n/a
 
      03-24-2006

Ian Collins 写道:

> Reji wrote:
> > Thanks Ian, But can i not use CreateProcess() and WaitForSingleObject
> > in a noraml C++ program? Forget the MFC application. How can I do it in
> > a C++ application?
> >

> I believe so, but they are windows functions, not part of standard C++.
>
> --
> Ian Collins.


If u can help, then do it anyway

 
Reply With Quote
 
Ian Collins
Guest
Posts: n/a
 
      03-24-2006
jimmy wrote:
> Ian Collins 写道:
>
>
>>Reji wrote:
>>
>>>Thanks Ian, But can i not use CreateProcess() and WaitForSingleObject
>>>in a noraml C++ program? Forget the MFC application. How can I do it in
>>>a C++ application?
>>>

>>
>>I believe so, but they are windows functions, not part of standard C++.
>>
>>--
>>Ian Collins.

>
>
> If u can help, then do it anyway
>

Who's u?

This is a C++ Language group, not a windows programming one. There are
plenty of those.

--
Ian Collins.
 
Reply With Quote
 
Ben Pope
Guest
Posts: n/a
 
      03-24-2006
jimmy wrote:
> Ian Collins 写道:
>
>> Reji wrote:
>>> Thanks Ian, But can i not use CreateProcess() and WaitForSingleObject
>>> in a noraml C++ program? Forget the MFC application. How can I do it in
>>> a C++ application?
>>>

>> I believe so, but they are windows functions, not part of standard C++.
>>
>> --
>> Ian Collins.

>
> If u can help, then do it anyway


He already did. He suggested "a windows programming group" since "this
isn't a C++ issue".

C++ does not have any native thread support, that support comes from an
OS, and is thus OS specific.

Ben Pope
--
I'm not just a number. To many, I'm known as a string...
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
.pdf doc to word doc PWB Computer Support 14 09-19-2008 10:41 PM
String[] files = {"a.doc, b.doc"}; VERSUS String[] files = new String[] {"a.doc, b.doc"}; Matt Java 3 09-17-2004 10:28 PM
opening a word doc in word not browser Stephen Witter ASP .Net 0 05-18-2004 02:48 AM
Parsing MS Word client doc into server-side doc... John Wallace ASP .Net 0 07-22-2003 06:49 PM



Advertisments