Click here to Skip to main content
11,718,589 members (84,554 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: Delphi
Hi all

I'm a complete newby to Delphi. Using RAD Studio XE. I am used to Visual Studio.

I created a project group and added a third party library. I created a new project with a GUI for experimenting.

I am just wondering how to add a reference from my GUI project to the Library project? In visual studio, you'd click "Add Reference" and find the referenced project.
Posted 16-May-11 14:02pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Delphi "Project group" is the concept similar to Visual Studio Solution.

If you use Delphi and not Delphi Prizm, it means you're not developing .NET assemblies but you're developing native Windows code. For native Windows, there is no a concept of assembly and there is no a concept of references.

Unfortunately, you can use only less robust lower-level concept of exporting and importing methods, which are not even object-oriented. (You can simulate very basic object-oriented features via explicit passing of "self" parameters, but this is an advanced technique which requires good understanding of OOP internals.) You can also use Delphi concept of package which is technically based on native import/export but ideologically close to .NET (Delphi is a major .NET predecessor). But packages are between Delphi projects. Let's talk about consuming native DLL in Delphi. Import is performed in source code using external key word.

Here is a simple example:

procedure DllMessage; external 'SimpleMessageDLL.dll';

Find a full code sample here:[^].

Alternatively, you can load a DLL during run-time using Windows API LoadLibrary/LoadLibraryEx and access DLL methods using GetProcAddress. See:[^],[^],[^].


This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 651
1 OriginalGriff 210
2 F-ES Sitecore 185
3 Jochen Arndt 160
4 Maciej Los 130
0 OriginalGriff 535
1 Maciej Los 529
2 Richard MacCutchan 440
3 CHill60 415
4 F-ES Sitecore 415

Advertise | Privacy | Mobile
Web02 | 2.8.150901.1 | Last Updated 16 May 2011
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100