How can I use the function in the DLL

Hi,

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

Thanks!
llucy88Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

kotikCommented:
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
RBertoraCommented:
Listening..
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

freterCommented:
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
simonetCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mhervaisCommented:
very good freter
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.