BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

ocx vs service

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Non-Technical
View previous topic :: View next topic  
Author Message
Brad White
Guest





PostPosted: Tue Aug 23, 2005 4:26 pm    Post subject: ocx vs service Reply with quote



We have an app that uses an OCX and processes some images in our database.
It kicks off the OCX and runs fine. We've run it more than 100 times with
no problems.

We moved it into a service to listen to TCP requests and started having
problems.
Usually in less than 5 runs it would start failing. The OCX would kick off,
but would return
all 0's for data. Once it failed, it never started working correctly again
until restarting the service.

Support for the OCX replied, "Oh, did you say service? We don't support
running
in a service."

We couldn't think of anything else, so we had our service spawn an exe and
wait.
I didn't expect it to work. The standalone console app that gets spawned
off should
inherit all the problems that the service had.
But it does work. It has run well over 150 times with no hint of problems.

Any idea what would be different about a service?

Everything is a similar as we could make it.
The service and the exe are both running as SYSTEM.
Both are located in System32.

--
Brad.

Vote for CodeRush in future versions of Delphi
http://qc.borland.com/wc/wc.exe/details?reportid=9138


Back to top
Craig Stuntz [TeamB]
Guest





PostPosted: Tue Aug 23, 2005 5:11 pm    Post subject: Re: ocx vs service Reply with quote



Brad White wrote:

Quote:
Any idea what would be different about a service?

Everything is a similar as we could make it.
The service and the exe are both running as SYSTEM.
Both are located in System32.

Threading? What threading model do you specify in your call to
CoInitializeEx in your service?

Another possibility is that the OCX somehow is dependent on the GUI.
You can test this by allowing your service to interact with the
desktop, but I would *not* recommend this for production software, as
it's a security problem.

--
Craig Stuntz [TeamB] . Vertex Systems Corp. . Columbus, OH
Delphi/InterBase Weblog : http://blogs.teamb.com/craigstuntz
All the great TeamB service you've come to expect plus (New!)
Irish Tin Whistle tips: http://learningtowhistle.blogspot.com

Back to top
Brad White
Guest





PostPosted: Tue Aug 23, 2005 11:51 pm    Post subject: Re: ocx vs service Reply with quote



"Craig Stuntz [TeamB]" <craig_stuntz (AT) nospam (DOT) please [a.k.a. acm.org]> wrote
in message news:430b58c4$1 (AT) newsgroups (DOT) borland.com...
Quote:
Brad White wrote:

Any idea what would be different about a service?

Everything is a similar as we could make it.
The service and the exe are both running as SYSTEM.
Both are located in System32.

Threading? What threading model do you specify in your call to
CoInitializeEx in your service?


We are calling CoInitialize. MSDN says that it calls Ex with an
ApartmentThreading flag.
Does that make a difference?

--
Brad.

Vote for CodeRush in future versions of Delphi
http://qc.borland.com/wc/wc.exe/details?reportid=9138



Back to top
Craig Stuntz [TeamB]
Guest





PostPosted: Thu Aug 25, 2005 7:47 pm    Post subject: Re: ocx vs service Reply with quote

Brad White wrote:

Quote:
We are calling CoInitialize. MSDN says that it calls Ex with an
ApartmentThreading flag.
Does that make a difference?

Not AFAIK. Try the GUI test (interact with desktop).

--
Craig Stuntz [TeamB] . Vertex Systems Corp. . Columbus, OH
Delphi/InterBase Weblog : http://blogs.teamb.com/craigstuntz
Everything You Need to Know About InterBase Character Sets:
http://blogs.teamb.com/craigstuntz/articles/403.aspx

Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Non-Technical All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.