Terminating VB components.

I create an NT service in Vb,that invokes an ActiveX Exe to do a background process. My problem is, when i stop the service i kill the object of the invoking ActiveX exe by setting it to nothing.(It executes fine, and the instance counter is 0) Even though that object sets to nothing, its still running its process in the back ground. How is this possible. Will this can be solved.
jojiAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

TimCotteeHead of Software ServicesCommented:
The reason for this is that you have only terminated the reference to the activeX exe from VB. The exe is still running, you will need to additionally terminate this application. There is some sample code which shows how this can be done in Microsoft KB, article:

HOWTO: Programmatically Close a Separate Application
Article ID: Q176391

Or look into the TerminateProcess API call.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jojiAuthor Commented:
I tried the way given in - HOWTO: Programmatically Close a Separate Application .
In this they are finding the handle of the window using FindWindow Api and then post a message WM_CLOSE to that Window. The FindWindow takes two paramaters (classname,windowname).
Since my program don't have a form (its an Active-x exe object) i can't use the 2nd paramater. And the 1st paramater is the Registered Window ClassName. This is possible only in VC++. I tried giving the class name of my Active-x exe, but still it runs in the backgroud process, after closing it.
0
jojiAuthor Commented:
Adjusted points to 100
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Programming Languages-Other

From novice to tech pro — start learning today.