word used in a service

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hello,

I have an application which has to run as a windows service. This
application create a word instance via a library of mine with the call:

word::_ApplicationPtr myApp;
myApp.CreateInstance("Word.Application.11");

(it is wrote in VC++)

Fom here i have two problems:

First i would like Word to use a temporary directory of mine instaed of the
global \Windows\temp\ one. I tried tu use _putenv (to set TEMP and TMP) just
before calling Createinstance but Word doesn't care and i tried to set the
service as a user instead of System but Word keep using the global
\Windows\temp\ direectory. What is disturbing me is when i launch the
application in a console, not as a service the Word instance use the temp
directory specified by _putenv. So my question is: What i have to do to see
Word using my specified Temp directory.

My second problème is when i make a specific treatment with the application
launched as a service i get word to "freeze" at a certain point. I am quite
sure it is because it opens a popup dialog and wait until a user answer the
question (i got a similar problem before that i solved by catching the popup
in console mode and set the corresponding code to not display this dialog
again). And I can't see this dialog since word is launched from a service
(and there I can't reproduce the problem in console mode). I tried to set a
specific user for the service or tried to check the box "Allow service to
interact with desktop" but i got nothing. So my second question is what can i
do to get what word want?

I use the computer where the application is launched with remote connection
desktop i hope it does not affect the interactions between services and destop

thanks in advance for any advice


.



Relevant Pages

  • Re: Switching from Console to GUI mode
    ... need to launch the web -browser. ... As the web browser cannot be launced ... in the console mode, so the browser get launch in GUI mode.As we are ... Can we have a capability so that any single key can work as ...
    (comp.os.linux.misc)
  • Re: Calling CreateDispatch to create Word Instance
    ... this DLL I have a Class CSpellCheck which is derived from CWinApp. ... CSpellCheck Constructor, I am trying to Launch the Word Instance using the ...
    (microsoft.public.vc.mfc)
  • Switching from Console to GUI mode
    ... need to launch the web -browser. ... As the web browser cannot be launced ... in the console mode, so the browser get launch in GUI mode.As we are ... Can we have a capability so that any single key can work as ...
    (comp.os.linux.misc)
  • Re: Switching from Console to GUI mode
    ... need to launch the web -browser. ... As the web browser cannot be launced ... in the console mode, so the browser get launch in GUI mode.As we are ...
    (comp.os.linux.misc)
  • timer with C
    ... I want to launch a function or a procedure every 100 ms, in an console mode ... Is there any howto for this? ... Manu ...
    (comp.os.linux.development.apps)