The API.DLL can be found in the MERAK directory and is used by the Users.exe command line
tool.
The source code for Users.exe can be found in the API directory and is written in Delphi.
The API can be used in any programming language such as Delphi, BC++ Builder, MS VC++, ASP,
VB etc.
All you need to do is to import the functions from the API DLL (Dynamic Linked Library).
In order to use the API you have to follow few rules:
1. Before calling any functions from the API, call the Init function and pass the full MERAK directory
to it.
2. All functions return a result. The result can be either negative or positive.
The positive results (including 0) indicate a success of the function. See the APIConst unit for
negative results. You should always check all results.
Function Init(Directory: PChar): Longint; StdCall;
Initializes the API. The directory contains the MERAK Mail Server installation path. This function
should be the first called function.
Function AddUser(Domain: PChar; Var Buffer; Size: Longint): Longint;
StdCall;
Adds a new user.
I windows kan detta komma som en födelsedagspresent iställetför felmeddelande... så jag kallar det numera för meddelande. Windows vet ju aldrig när det ska vara si eller så.
------------------
O Yeah!
Mitt motto: I wouldn't if I couldn't
Eftersom API.DLL är en DLL så kan man inte anropa den direkt från ASP sidan
(Inte så vitt jag vet).
Å andra sidan kanske man ändå måste fixa/trixa med anrop och parameterpassningar så det är lika bra att göra den ASP vänlig genom att göra anropen från ett COM-objekt.
Har du använt databaskopplingar från ASP så har du redan provat på att använda COM-objekt.
Man gör ett COM-objekt med funktioner typ:
AddUser(Domain...)
...
Sedan är det bara att på ASP sidan skriva:
Set MailServer = Server.CreateObject("MAREK.MailServer")
MailServer.AddUser('Kalle')
Set MailServer = Nothing
Inte helt trivialt men är man duktig på att göra COM objekt i Delphi/VB är det ingen match.
Själv använder jag Delphi.
131 ms totalt · 3 externa anrop · v20260731065814-full.58439ac5