?
Solved

Services under Win NT

Posted on 1997-04-21
2
Medium Priority
?
262 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 4

Accepted Solution

by:
erajoj earned 100 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
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…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

649 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