(Thus speaketh the Delphi Help):
 
Importing functions from DLLs
 
To import routines from a dynamic-link library, attach a directive of the form
 
external stringConstant;
 
to the end of a normal procedure or function header, where stringConstant is the name of the .DLL file in single quotation marks. For example,
 
function SomeFunction(S: string): string; external 'strlib.dll';
 
imports a function called SomeFunction from STRLIB.DLL.
You can import a routine under a different name from the one it has in the DLL. If you do this, specify the original name in the external directive:
 
external stringConstant1 name stringConstant2;
 
where the first stringConstant gives the name of the .DLL file and the second stringConstant is the routine’s original name. For example, the following declaration imports a function from USER32.DLL (part of the Windows API).
 
function MessageBox(HWnd: Integer; Text, Caption: PChar; Flags: Integer): Integer;
  stdcall; external 'user32.dll' name 'MessageBoxA';
 
The function’s original name is MessageBoxA, but it is imported as MessageBox.
Instead of a name, you can use a number to identify the routine you want to import:
 
external stringConstant index integerConstant;
 
where integerConstant is the routine’s index in the DLL export table.
 
-ns
----- Original Message -----
Sent: Sunday, February 11, 2001 08:44
Subject: [DUG]: Dll Function Name

HI all.
 
I have a function the maps to a function in a DLL.
i.e. function reset(szType: PChar): Smallint; stdcall; external 'mydll';
 
is there a way that I can make like an Alias to this function ?
The problem is, that ReSet is a valid function that I use when I open a test file, so it craps out.
 
anyone got any Ideas ?
 
Cheers, Jeremy Coulter

Reply via email to