Solved

Creating a DLL.

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
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…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
Need to grow your business through quality cloud solutions? With everything required to build a cloud platform and solution, you may feel like the distance between you and the cloud is quite long. Help is here. Spend some time learning about the Con…

930 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

13 Experts available now in Live!

Get 1:1 Help Now