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

x
?
Solved

Creating a DLL.

Posted on 2000-04-11
4
Medium Priority
?
162 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 400 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 Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
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…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses

705 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