Re: Riddle Me This
- From: "Willy Denoyette [MVP]" <willy.denoyette@xxxxxxxxxx>
- Date: Sat, 12 Jan 2008 02:12:12 +0100
"pbd22" <dushkin@xxxxxxxxx> wrote in message news:a023891e-6d6a-4c77-a39c-758f112cb81f@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
What makes you think the exec is not started, is the process not visible in
the process list?
That is right.
If not, how does the program signals success/failure to
the parent process (the service in this case)?
Well, its a queue. There is no return value. We know the proccess
takes
about 2 seconds. So, it should run accordingly. If one is running when
the
other wants to run, it queues until the first one is done.
How do you start the exec, show us the code that start the exec.
Here is the code:
if (filetype = true)
{
try
{
ProcessStartInfo psi = new
ProcessStartInfo(exepath, args);
lock (_objLock)
{
if (_fProcessRunning)
{
_procq.Enqueue(psi);
psi = null;
}
_fProcessRunning = true;
}
if (psi != null)
{
StartAProcess(psi);
}
}
catch (Exception e)
{
eventLog1.WriteEntry("Error parsing file:" +
e.Message, EventLogEntryType.Error);
return;
}
}
}
void StartAProcess(ProcessStartInfo psi)
{
try
{
Process process = new Process();
process.StartInfo = psi;
process.EnableRaisingEvents = true;
process.Exited += ProcessExitedHandler;
process.Start();
}
catch (Exception e)
{
eventLog1.WriteEntry("Error with StartAProcess
method:" + e.Message, EventLogEntryType.Error);
return;
}
}
void ProcessExitedHandler(object sender, EventArgs e)
{
ProcessStartInfo psi = null;
lock (_objLock)
{
if (_procq.Count > 0)
{
psi = _procq.Dequeue();
}
else
{
_fProcessRunning = false;
}
}
if (psi != null)
{
StartAProcess(psi);
}
}
Give also some details about the exec, type of program,
VB6 application. That has been stripped of all UI "stuff".
what security and user context does it require to run in,
Can you tell me how I would find that out?
does it expect a user profile to be loaded?
No. It simply does the following:
Opens a file.
Extracts metadata.
Writes metadata to text file.
Closes file.
Thanks a ton!
Peter
What I wan is the Service code that initiate a process start, that is the call site of the piece of code you posted above (starting with if (filetype = true), which is not the start of a method I suppose. I also would suggest you to add some logging stuff to the above code.
Also, you can't strip all UI stuff from VB6 application,a VB6 application is by definition a windows application, which makes it hard to get started from a Windows Service.
Willy.
.
- Follow-Ups:
- Re: Riddle Me This
- From: pbd22
- Re: Riddle Me This
- References:
- Riddle Me This
- From: pbd22
- Re: Riddle Me This
- From: Michael C
- Re: Riddle Me This
- From: pbd22
- Re: Riddle Me This
- From: Michael D. Ober
- Re: Riddle Me This
- From: DeveloperX
- Re: Riddle Me This
- From: pbd22
- Re: Riddle Me This
- From: pbd22
- Re: Riddle Me This
- From: pbd22
- Re: Riddle Me This
- From: Willy Denoyette [MVP]
- Re: Riddle Me This
- From: pbd22
- Re: Riddle Me This
- From: pbd22
- Re: Riddle Me This
- From: Willy Denoyette [MVP]
- Re: Riddle Me This
- From: pbd22
- Re: Riddle Me This
- From: Willy Denoyette [MVP]
- Re: Riddle Me This
- From: pbd22
- Riddle Me This
- Prev by Date: Re: DataAdapter Scope
- Next by Date: Re: Hash Code Of A String
- Previous by thread: Re: Riddle Me This
- Next by thread: Re: Riddle Me This
- Index(es):