Solved

Creating a DLL.

Posted on 2000-04-11
4
160 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
[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
 
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

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

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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

728 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