Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to use API in a DLL?

Posted on 1999-07-25
4
Medium Priority
?
255 Views
Last Modified: 2010-04-04
Hello,
Suppose a DLL named "extra.dll" which contains a lot of APIs.  One of the API descriptions copied from the DLL document:
BOOL WINAPI ExtraAPICall_SetRegKey(char *pszName, char *pszCompany, char *pszRegcode);
How can I include/declare the DLL, and how to use the APIs?
Thanx.
PS.  Full source wanted.  Coming with the DLL, there are also some files, such as extracall.h, extrainterface.h;  seems that the DLL is written by C++.
0
Comment
Question by:yingkit
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 

Author Comment

by:yingkit
ID: 1391026
Edited text of question.
0
 
LVL 10

Accepted Solution

by:
viktornet earned 90 total points
ID: 1391027
function ExtraAPICall_SetRegKey(pszName : pchar, pszCompany : pchar, pszRegcode : pchar) : boolean; stdcall; external "extra.dll" name 'ExtraAPICall_SetRegKey';

then you can use it as if you were using any other API..

..-=ViKtOr=-..
0
 

Author Comment

by:yingkit
ID: 1391028
Hi Viktor,
One more, can you please tell me how to use the following API?
BOOL WINAPI ExtraAPICall_GetDetails(int &iCount, HWND &hWindow);
From the document, it states that this has NO input arguments, but has output returns.
Thx!
0
 
LVL 10

Expert Comment

by:viktornet
ID: 1391029
In fact it has two arguments... some kinda count and a handle to a a window... that might be an edit box or whatever...

I've no idea what GetDetails() does... I've never heard of it.. the documentation you have should tell you what to do...

btw, the parameters are references, just like a pointer, but you don't pass a pointer... rather, you pass it a normal variable... in Delphi that'd be eclared with the VAR statements..

getdetails(var coiunt : integer;.....);

Good Luck!!

..-=ViKtOr=-..

..-=ViKtOr=-..
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

660 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