Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do i add a component??

Status
Not open for further replies.

RobPouwelse

Technical User
Nov 19, 2001
77
NL
I have donwloaded a program (Tetris) for delphi with sourcecode (freeware)

It uses it's own component..

But i don't know how to add a component..Heck, i don't even know what extension a component has (user made)..

is it .dcu?? i looked in the delphi help but it only says how to create one..

so when i try to open the sourcecode of the program (tetris) it needs the component.. but i don't know how to add it..

components|install component asks for a .dpk file and i didn't get it with the source..

help??
 
Is there a Pascal file for the component? (.pas)
you should be able to install with this using Component/Install Component.

The thing is a bit naff if there are no instructions for instlling the component, as this can vary between versions of Delphi. Some components written on early versions won't even run on the new ones. and vice versa.

Components are sometimes in Package files. (.dpk) but there are other extensions involved with this as well (not sure if I understand it myself).

If there is only one componet There dosnt seem to be much point in placing it in a package anyway.

I belive thet some versions of Delphi will install components from a .dcu file, but not all.

Generally make sue that the paths are correct. Stick the component code in the samples folder that might work as the path should be preset.

If you have the source code (*.pas) and it's written for your version of Delphi then it should be strightforward.
If you dont have the source then it should have install instructions if not there could/will be problems.

If someone has a simple fits all answer to this then 'good on em' as we say around here.

Steve.
 
What are the extensions of the software you downloaded? Sounds like you need to update a USE line.
 
.dcr
.dcu
.pas
(all with the same name:KozyTetris

and it has a zip KTdemo.zip
in that zip there is a demo program..

project1.dof
project1.dpr (project)
project1.dsk (disk?)
project1.res (resource?)
unit1.~df
unit1.~pa (backups?)
unit1.dcu
unit1.dfm (form)
unit1.pas (unit)

that's it.. there is a txt file that describe that properties and methods and stuff of the component but not how to install it...

if i'm correct (i'm not sure) it was made in Delphi 4(the one i'm using right now)
 
I think the component could be that KozyTetris.pas. To be sure though, all components would have a method with the line RegisterComponent in them. So you can check which of you .pas files have that.

The name of the component Delphi says you need should also give you a hint as to which source file has the components if you look through them.

By the way, from personal experience not too long ago, if you're sure you've nailed the right component file but it won't install then it won't install. Trying to get it to compile will really frustrate you. The problem lies in that the different versions of Delphi are rarely compatible when it comes to components.
 
Sggaunt,

Like I said, I recently found installing components a nightmare so I thought a might give him a little bit of extra advice.
 
My advice, I would rather pay for a component then use freeware, at least you supposed to get some support when you need to. Too many headaches. S. van Els
SAvanEls@cq-link.sr
 
True
But what if you want to distribute your application for less than the cost of the component (or even for free).
There is a lot of competition out there for small outfits, If(we) want to produce somthing competitive I dont think there is much choice but to use Freeware. I am thinking of things like Internet connectivity which is a must these days. I am using a freeware comp to do this currently and it works fine.
I take your point of course, to give another exaple I also use a freeware component to be able to use HTML help (No support in D4). This has problems, but the alternatives are expensive, far more that I can justify.

You pays your money (or not) and takes your choice as they say..

Steve
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top