Solved

Services under Win NT

Posted on 1997-04-21
2
246 Views
Last Modified: 2010-04-04
The Win32 help file in Delphi 2 has a bunch of functions for managing services under Windows NT, such as OpenService, OpenSCManager, QueryServiceStatus, StartService, CloseServiceHandle and many more, but when I try to use them I get "Undeclared identifier: OpenService". What am I missing?
0
Comment
Question by:freyrb
2 Comments
 
LVL 4

Accepted Solution

by:
erajoj earned 50 total points
ID: 1335580
D2 has no support these functions since there are no interfaces
for then in the RTL's. However; you can always use standard
DLL calls to reach the functions. The problem is to find them.
I searched and found the functions in these DLL's:

  advapi32.dll, dhcpcsvc.dll, drivers .dll, netapi32.dll,
  netui1  .dll, ole32   .dll, rpcns4  .dll, rpcrt4  .dll,
  security.dll

You've better try'em and find out for your self which one
it is. Maybe someone can give us a clue?

0
 

Author Comment

by:freyrb
ID: 1335581
The main DLL is advapi32.dll, but has two sets of all function where you can select between UNICODE and ANSI. These functions' names are appended with A for ANSI and W for UNICODE, e.g. StartServiceA and StartServiceW. So a typical declaration would be:
function StartService; external 'ADVAPI32.DLL' name 'StartServiceA';
0

Featured Post

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

810 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