RE: [Boost-Users] Re: Regex in a service..
Okay, I now know how to attach to a process - cool! Thanks for that.. However, it looks like when I comment out the following: Regex expression(strMask); The service can start and I can attach and run through it, but if I uncomment it (which is what I need to do), essentially it IMMEDIATELY fails with a ERROR 1053: The service did not respond to the start or control request in a timely fashion. Is it possible that its not finding the proper libraries or a permissions problem is happening? Thanks Loren -----Original Message----- From: Mark Sizer [mailto:yg-boost-users@m.gmane.org] Sent: Saturday, June 14, 2003 6:48 PM To: boost-users@yahoogroups.com Subject: [Boost-Users] Re: Regex in a service.. Yes, you can debug it. After starting the service, open the Task Manager and get the process ID. Then type "msdev -p <pid>" on a command line. If the error happens too quickly (e.g. on startup), put an infinite loop at the very start and break out of it with the debugger. int i=1; while (i > 0 ); is my favorite. Just change i to zero and everything starts going as normal (just don't forget to take it out!). Good Luck, - Mark P.S. I'm using regex in a service and it's working fine (at least I assume it is, nothing noticably bad has happened). MSVC 6, boost_1_30_0, W2K AS and W2K Pro. Koss, Loren wrote:
John,
Thanks for the response. How do you deal with breakpoints within a service? I'm compiling then starting the service from the service control manager. Will I still be able to debug it?
I seem to be having a difficult time using the Regex class in a service. It works wonderfully in a regular app. Can anyone help me out.. Basically, instantiating a regex class raises an exception. Any thoughts?
Not unless you can tell me what exception and where - if you're using the vc ide then set it to break on OS and C++ exceptions.
John.
Yahoo! Groups Sponsor <http://us.adserver.yahoo.com/l?M=247865.3425083.4707139.1261774/D=egroupmai l/S=:HM/A=1482387/rand=217687422> Info: <http://www.boost.org http://www.boost.org > Wiki: <http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl > Unsubscribe: mailto:boost-users-unsubscribe@yahoogroups.com Your use of Yahoo! Groups is subject to the Yahoo! http://docs.yahoo.com/info/terms/ Terms of Service. [Non-text portions of this message have been removed]
It seems likely that it's not finding the regex DLL. Remember that services start in a different environment than user processes. It's possible, probable in fact, that the paths are different. As a quick check, copy the regex dll to the system directory (usually C:\WINNT\system32). If the service then starts, you know the problem and can figure out a better solution (what that is depends a lot on your situation). My personal favorite solution: Add "." at the start of the system path and put the DLLs in the same directory as the service. - Mark Koss, Loren wrote:
Okay, I now know how to attach to a process - cool! Thanks for that.. However, it looks like when I comment out the following:
Regex expression(strMask);
The service can start and I can attach and run through it, but if I uncomment it (which is what I need to do), essentially it IMMEDIATELY fails with a ERROR 1053: The service did not respond to the start or control request in a timely fashion. Is it possible that its not finding the proper libraries or a permissions problem is happening?
Thanks
Loren
-----Original Message----- From: Mark Sizer [mailto:yg-boost-users@m.gmane.org] Sent: Saturday, June 14, 2003 6:48 PM To: boost-users@yahoogroups.com Subject: [Boost-Users] Re: Regex in a service..
Yes, you can debug it. After starting the service, open the Task Manager and get the process ID. Then type "msdev -p <pid>" on a command line.
If the error happens too quickly (e.g. on startup), put an infinite loop at the very start and break out of it with the debugger.
int i=1; while (i > 0 );
is my favorite. Just change i to zero and everything starts going as normal (just don't forget to take it out!).
Good Luck, - Mark
P.S. I'm using regex in a service and it's working fine (at least I assume it is, nothing noticably bad has happened). MSVC 6, boost_1_30_0, W2K AS and W2K Pro.
Koss, Loren wrote:
John,
Thanks for the response. How do you deal with breakpoints within a
service?
I'm compiling then starting the service from the service control manager. Will I still be able to debug it?
I seem to be having a difficult time using the Regex class in a service. It works wonderfully in a regular app. Can anyone help me out.. Basically, instantiating a regex class raises an exception. Any thoughts?
Not unless you can tell me what exception and where - if you're using the
vc
ide then set it to break on OS and C++ exceptions.
John.
Yahoo! Groups Sponsor
<http://us.adserver.yahoo.com/l?M=247865.3425083.4707139.1261774/D=egroupmai l/S=:HM/A=1482387/rand=217687422>
Info: <http://www.boost.org http://www.boost.org > Wiki: <http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl > Unsubscribe: mailto:boost-users-unsubscribe@yahoogroups.com
Your use of Yahoo! Groups is subject to the Yahoo! http://docs.yahoo.com/info/terms/ Terms of Service.
[Non-text portions of this message have been removed]
Info: http://www.boost.org Wiki: http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl Unsubscribe: mailto:boost-users-unsubscribe@yahoogroups.com
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
On Mon, 16 Jun 2003 09:05:57 -0700, Koss, Loren wrote
The service can start and I can attach and run through it, but if I uncomment it (which is what I need to do), essentially it IMMEDIATELY fails with a ERROR 1053: The service did not respond to the start or control request in a timely fashion. Is it possible that its not finding the proper libraries or a permissions problem is happening?
Windows services have to respond to the Windows Service Control Manager (SCM) within a certain amount of time (a few seconds as I recall) or the SCM will assume the start has failed. How long is your Regex taking? Perhaps you should put the Regex in another thread so that your SCM responses are timely.... HTH, Jeff
participants (3)
-
Jeff Garland
-
Koss, Loren
-
Mark Sizer