Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Pascal
Expertise: Beginner
May 13, 1997

How to call a Win 32 API function that doesn't appear in Windows.pas

Question:
How can I call a Win 32 API function that doesn't appear in Windows.pas (EX: NetUserAdd)? I found it in the Delphi Help file, but cannot find it in Windows.pas.

Answer:
I know it gets confusing, but the Windows API function calls, while primarily in Windows.PAS, are not all contained there. There are several other files such as Messages.PAS, ShlObj.PAS, ShellAPI.PAS, TLHELP32.PAS, etc. These comprise what is known as the WinAPI.

With respect to the function you found, that is specific to Windows NT, and only available through the NETAPI32.DLL, which is not interfaced with a PAS file. This means you have to write your own interface to it. At the very least you'll have to make your own external function declaration referring to this DLL. But it'll only work on NT.

DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date