AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Component From Dll

Ein Thema von mohfa · begonnen am 17. Mai 2008 · letzter Beitrag vom 18. Mai 2008
Antwort Antwort
mohfa

Registriert seit: 11. Feb 2007
97 Beiträge
 
Delphi 7 Enterprise
 
#1

Component From Dll

  Alt 17. Mai 2008, 11:18
Hi every One , i want to ask you about this Issue :
Is Possible to declare a Component Class in a Dll then Create or Use it in my Application ?
i mean :
Let's suppose i have in the Dll :

Var
MyLabel:TTntLabel;

so can i use this in my App like ?:

MyLabel.Create( Self );

without using the Unit (tntClasses or whatever tntxxx ) in my App uses clause .
just create the MyLabel in the App .


regards.
  Mit Zitat antworten Zitat
mkinzler
(Moderator)

Registriert seit: 9. Dez 2005
Ort: Heilbronn
39.861 Beiträge
 
Delphi 11 Alexandria
 
#2

Re: Component From Dll

  Alt 17. Mai 2008, 11:23
No, in this case you could use a bpl
Markus Kinzler
  Mit Zitat antworten Zitat
mohfa

Registriert seit: 11. Feb 2007
97 Beiträge
 
Delphi 7 Enterprise
 
#3

Re: Component From Dll

  Alt 17. Mai 2008, 19:03
Zitat von mkinzler:
No, in this case you could use a bpl
thank you mkinzler , but if i declare the unit Tntxxx in the Dll only , and create or use the TTntLabel in the App .

is this Possible ? .

or what do you suggest .

regards.
  Mit Zitat antworten Zitat
mkinzler
(Moderator)

Registriert seit: 9. Dez 2005
Ort: Heilbronn
39.861 Beiträge
 
Delphi 11 Alexandria
 
#4

Re: Component From Dll

  Alt 17. Mai 2008, 19:08
It's not possible to use delphi classes in the interface of a dll.
Markus Kinzler
  Mit Zitat antworten Zitat
Medium

Registriert seit: 23. Jan 2008
3.686 Beiträge
 
Delphi 2007 Enterprise
 
#5

Re: Component From Dll

  Alt 17. Mai 2008, 19:33
You might be able to let a DLL create an object and use in your host (named pipes, clipboard, WM_COPYDATA), and maybe even reroute the logic of a class to the DLL, but you will always need at least an empty prototype of that class declared in the namespace of your application to access methods and fields/properties. There might even be a way to write your own little "RTTI", with which you could do this for arbitrary structures, but as this term already indicates: This wouldn't have too much in common with objects/classes in the common sense.
Further more, to attempt this for already existing classes, you would have to essentially rewrite them, or at least modify them heavily. What will never work is, that you could install them as actual "components", so that you could move and edit these inside the Delphi IDE.

Maybe COM/ActiveX can take you there, but again, heavy modifications will probably be neccessary, and since I'm not too familiar with these, I don't know whether there are serious downsides while using them.

In any case, this will result in a more or less dirty hack
"When one person suffers from a delusion, it is called insanity. When a million people suffer from a delusion, it is called religion." (Richard Dawkins)
  Mit Zitat antworten Zitat
Benutzerbild von Jelly
Jelly

Registriert seit: 11. Apr 2003
Ort: Moestroff (Luxemburg)
3.741 Beiträge
 
Delphi 2007 Professional
 
#6

Re: Component From Dll

  Alt 18. Mai 2008, 10:39
As mkinzler suggested... Use a BPL... It's intended for that.
Disadvantage: You can only the BPL in Delphi programs.

If you want to be flexible building DLLs and using them from different languages, so you might want to swap to the .NET framework.
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 15:59 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz