Solved

Creating NT Service with ATL

Posted on 2001-08-15
9
361 Views
Last Modified: 2013-11-25
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
Comment
Question by:jasonclarke
  • 4
  • 2
  • 2
  • +1
9 Comments
 
LVL 4

Expert Comment

by:IainHere
Comment Utility
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
 
LVL 7

Expert Comment

by:jimwasson
Comment Utility
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
 
LVL 9

Author Comment

by:jasonclarke
Comment Utility
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
 
LVL 2

Expert Comment

by:VCStud
Comment Utility
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 9

Author Comment

by:jasonclarke
Comment Utility
> 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
 
LVL 7

Expert Comment

by:jimwasson
Comment Utility
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
 
LVL 9

Author Comment

by:jasonclarke
Comment Utility
It seems that the registry on my machine may actually be broken...Windows Installer and other things won't run correctly now...
0
 
LVL 4

Accepted Solution

by:
IainHere earned 100 total points
Comment Utility
Hmm. <thinks>

Did you try going back to Unix?
0
 
LVL 9

Author Comment

by:jasonclarke
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

As more and more people are shifting to the latest .Net frameworks, the windows presentation framework is gaining importance by the day. Many people are now turning to WPF controls to provide a rich user experience. I have been using WPF controls fo…
For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now