Solved

Services under Win NT

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Delphi TcxGrid group footer summary 3 206
Delphi : could not find program, '...exe' 2 147
Downloading email attachments 2 67
CheckListBox usage 3 50
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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 this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

911 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

15 Experts available now in Live!

Get 1:1 Help Now