Simple ATL Object in my Windows Service 
Author Message
 Simple ATL Object in my Windows Service

Hi, I'm back, or rather still around. I wrote an ATL Windows Service using
VS 6 and it works beautifully. Now we need to get some statistics out of it,
and the simplest method, I thought (shouldn't have), is for the service to
write the results into a data area (not shared memory, just data globally
accessible in the process), and then add a Simple ATL object (default
settings, Apartment, Dual and Aggregation, even though I don't need
aggregation) to the service in order to retrieve the data, critical section
in place for locking, etc. I then wrote a VB client to create the Simple ATL
Object and obtain the data. Now here are the problems:
1) The client program hangs on the call where it creates the object, not
calling any methods yet, just creating the obj.
2) After attempting this, I can't even shut down the service.

What's wrong with my brilliant idea?

Thanks.



Tue, 26 Apr 2005 12:47:08 GMT  
 Simple ATL Object in my Windows Service


Fri, 19 Jun 1992 00:00:00 GMT  
 Simple ATL Object in my Windows Service
I forgot to say that when my service starts, it starts a thread that does
the work cyclically, so the Simple ATL obj is the first obj created in the
windows service that I'm trying to access from the outside. So basically,
rather than the long story below, I could have asked "how does one create a
Simple ATL obj in your windows service so that you can access it from a
client program running on the same computer".

Thanks.


Quote:
> Hi, I'm back, or rather still around. I wrote an ATL Windows Service using
> VS 6 and it works beautifully. Now we need to get some statistics out of
it,
> and the simplest method, I thought (shouldn't have), is for the service to
> write the results into a data area (not shared memory, just data globally
> accessible in the process), and then add a Simple ATL object (default
> settings, Apartment, Dual and Aggregation, even though I don't need
> aggregation) to the service in order to retrieve the data, critical
section
> in place for locking, etc. I then wrote a VB client to create the Simple
ATL
> Object and obtain the data. Now here are the problems:
> 1) The client program hangs on the call where it creates the object, not
> calling any methods yet, just creating the obj.
> 2) After attempting this, I can't even shut down the service.

> What's wrong with my brilliant idea?

> Thanks.



Tue, 26 Apr 2005 13:19:34 GMT  
 Simple ATL Object in my Windows Service

Quote:
> I forgot to say that when my service starts, it starts a thread that does
> the work cyclically, so the Simple ATL obj is the first obj created in the
> windows service that I'm trying to access from the outside. So basically,
> rather than the long story below, I could have asked "how does one create
a
> Simple ATL obj in your windows service so that you can access it from a
> client program running on the same computer".

Unless I'm missing something, you should be able to simply register your
object's instance in the ROT so the client(s) can access it easily.

--

Ehsan Akhgari



[WWW: http://www.beginthread.com/Ehsan ]



Tue, 26 Apr 2005 15:11:55 GMT  
 Simple ATL Object in my Windows Service
Hi Chris,


Quote:
> I forgot to say that when my service starts, it starts a thread that does
> the work cyclically, so the Simple ATL obj is the first obj created in the
> windows service that I'm trying to access from the outside. So basically,
> rather than the long story below, I could have asked "how does one create
a
> Simple ATL obj in your windows service so that you can access it from a
> client program running on the same computer".

what does it mean "cyclically" ?
Is your service Appartment- or Multithreaded (see comment in
CServiceModule::Run())?
Where is the critical section used ??

Regards
Juergen



Sun, 08 May 2005 22:19:27 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Help creating a simple service using ATL Service

2. Simple ATL Com object problem on simplest examples

3. Returns a ATL Simple object by a method of another ATLSimple object

4. Simple ATL Object-Returning a value to the calling object

5. Simple Question About ATL Service Wizard?

6. Simple ATL 7.0 Service question

7. ATL Service with COM Object called by ISAPI Extension

8. Can't use an Automation object in an ATL Service

9. Problem debugging VB COM object from a ATL-Service

10. Instantiating com object in atl service

11. ATL Service instantiating a VB com object

12. ATL simple object wizard

 

 
Powered by phpBB® Forum Software