Solved

Creating a DLL.

Posted on 2000-04-11
4
148 Views
Last Modified: 2010-04-04
I want to create a DLL. I select from menu File|New|DLL. Then I edit the "Library". And then?
0
Comment
Question by:val84
  • 2
  • 2
4 Comments
 
LVL 12

Accepted Solution

by:
rwilson032697 earned 100 total points
ID: 2706621
You would do something like this:

Write a procedures/functions to do what you want, eg:

library MyDLL;

// Etc

function CalculateSomething(AnArgument : Double) : Double; cdecl;

begin
  result := <Some calculation>
end;

end.

Lets call the DLL 'MyDLL.DLL'.

You could use this DLL in an application like this:

unit MyDLL;

interface

Function CalculateSomething(AnArgument : Double) : Double; cdecl;

implementation

Function CalculateSomething(AnArgument : Double) : Double; cdecl; external 'MyDLL.DLL' name 'CalculateSomething';
end;

end.

In some unit of your program you can add the MyDLL unit to the uses clause and call the function like this:

CalculateSomething(1.2);

Cheers,
Raymond.
0
 

Author Comment

by:val84
ID: 2706881
Hi Raymond.
My problem is this: when I try to create a DLL, as I told you before, Delphi opens a "Project1.dpr" window. But I want to create a .DLL not a .DPR.
What am I supposed to do?
Alex.
0
 
LVL 12

Expert Comment

by:rwilson032697
ID: 2706964
The project is always a .DPR file. When you compile the DLL project the result will be a .DLL file!

Cheers,

Raymond.
0
 

Author Comment

by:val84
ID: 2707019
Hi Raymond.
It worked OK. All is well that ends well.
Thanks, Alex.
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

706 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now