?
Solved

How can I use the function in the DLL

Posted on 1999-11-01
6
Medium Priority
?
216 Views
Last Modified: 2010-04-04
Hi,

I want to write a program which will use the functions in TAPI32.dll. How can I do that?

Thanks!
0
Comment
Question by:llucy88
6 Comments
 
LVL 2

Expert Comment

by:kotik
ID: 2174607
Hi, llucy88.
There is two ways to use a func in a DLL.
First is the static linking, e.g.:
//-----------
interface

function GetBinaryTypeW(lpApplicationName: PWideChar; var lpBinaryType: DWORD): BOOL; stdcall;

implementation

function GetBinaryTypeW; external kernel32 name 'GetBinaryTypeW';
//------------

The second method requires some skill.
You have to use LoadLibrary, FreeLibrary and GetProcAddress.

0
 
LVL 7

Expert Comment

by:RBertora
ID: 2174610
Listening..
0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

 
LVL 2

Expert Comment

by:freter
ID: 2174625
here's hwo to use dynamic binding using LoadLibrary and the like:

InstanceHandle := Loadlibrary (pchar(FileName));
if InstanceHandle = 0 then
  raise Exception.Create('Couldn't load library')
else begin
  @DLLProc := GetProcAddress (InstanceHandle, 'FunctionName');
  DLLProc(Parameters);
  FreeLibrary(InstanceHandle);
end;

</freter>
0
 
LVL 15

Accepted Solution

by:
simonet earned 200 total points
ID: 2175476
Go to

http://www.delphi-jedi.org/Jedi:API_TELEPHONY:231514347

and download the already-converted TAPI (J-TAPI) header files. That way you can simply using the functions in TAPI.DLL without worrying about loading/unloading the DLL or how to import the functions (or even what functions to import). It's already all there for you to use.

Yours,

Alex
0
 
LVL 4

Expert Comment

by:mhervais
ID: 2175477
very good freter
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
The Relationships Diagram is a good way to get an overall view of what a database is keeping track of. It is also where relationships are defined. A relationship specifies how two tables connect to each other. As you build tables in Microsoft Ac…
This video tutorial shows you the steps to go through to set up what I believe to be the best email app on the android platform to read Exchange mail.  Get the app on your phone: The first step is to make sure you have the Samsung Email app on your …

599 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