Solved

Services under Win NT

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

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

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

746 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

10 Experts available now in Live!

Get 1:1 Help Now