Solved

Services under Win NT

Posted on 1997-04-21
2
252 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

830 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