• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 397
  • Last Modified:

Creating NT Service with ATL

I am attempting to create an NT Service using the ATL Object Wizard.

Even with the simplest of objects, I can create the object (i.e. CoCreateInstance works), but any attempt to call any method on the created objects results in a 'Permission Denied' message.

Anybody have any ideas about what might be going wrong?
0
jasonclarke
Asked:
jasonclarke
  • 4
  • 2
  • 2
  • +1
1 Solution
 
IainHereCommented:
Does the user account you're using have full control permission in the registry for the object?

http://www.winntmag.com/Articles/Index.cfm?ArticleID=5375
0
 
jimwassonCommented:
What OS are you using (NT or Win2K)?  You probably already know but you need to have Administrator privileges on NT (at least) Power User on Win2K to access a Service.  Also, you have to grant both launch and access permission to the object.
0
 
jasonclarkeAuthor Commented:
Sorry for the lack of response...

I am running Win2K,  I have local administrator priviliges on my machine, and I appear to be able to alter any permissions I need to.  
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
VCStudCommented:
Hi,

You need to set permissions for all those people who will access the methods of your service. To do this follow the steps,

Type dcomcnfg in the 'Run' box. This will open dcom configuration. It lists the COM dll's and exe's. Select your service and click properties. In the 'Security' tab, select Custom 'access permissions' and 'launch permissions'. Using the edit button, add the people you want to give access to the service.

This would let you access the methods and you would not get the error message.

Cheers,
VCStud
0
 
jasonclarkeAuthor Commented:
> This would let you access the methods
> and you would not get the error message.

I tried this, and it seems that no matter who or what I give access to (I gave access to Everyone), I still get Permission denied when attempting to call a method.

Also, as I said this problem occurs even with simple local activations.
0
 
jimwassonCommented:
As to granting permissions, have you included "SYSTEM" as having both launch and access permission to your service?  On my project, we have to do that as well.
0
 
jasonclarkeAuthor Commented:
It seems that the registry on my machine may actually be broken...Windows Installer and other things won't run correctly now...
0
 
IainHereCommented:
Hmm. <thinks>

Did you try going back to Unix?
0
 
jasonclarkeAuthor Commented:
Sorry, I forgot to clear up this question.

Since, the question was really a 'non-question' - caused by a Windows disaster on my machine, I will give the points to the person who suggested what I would *like* to do.
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 4
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now