Board index » cppbuilder » Compoents not seen after package installation

Compoents not seen after package installation


2004-12-16 01:54:46 PM
cppbuilder23
Hi!
I have the following code in the .cpp where the components code resides:
namespace MyComps
{ void __fastcall PACKAGE Register(){
TComponentClass classes[2] = {__classid(TMyComp1),__classid(MyComp2)};
RegisterComponents("My Components", classes, 1);
}
}
Make and Install finishes with this message:
Package c:\borland\cbuilder6\Projects\Bpl\PkgMyComps.bpl has been
installed.
Entry "PkgMyComps" does exist in "Design packages" in "Component | Install
Packages",
but clicking on button "Components", I see nothing in "Installed
compoents" group box.
I have also tried removing PkgMyComps entry from "Design packages" in
"omponent | Install Packages", and pushing "Add" button and pulling out
file C:\borland\cbuilder6\Projects\Bpl\PkgMyComps.bpl. The result is the
same - fruitless.
Where are my components?
Thanks in advance!
CN
 
 

Re:Compoents not seen after package installation

"CN" < XXXX@XXXXX.COM >wrote in message
Quote
namespace MyComps
Your namespace is wrong. I am assuming that you wrote it yourself manually,
is that right? The 'C' must be 'c' instead. Only the first letter should
be capitalized, the rest must be all lowercase.
Quote
Make and Install finishes with this message:

Package c:\borland\cbuilder6\Projects\Bpl\PkgMyComps.bpl
has been installed.
Your components were not installed. If they had been, the actual class
names would have been listed in that message. Which suggests to me that
your package is not actually set up properly in the first place.
Gambit
 

Re:Compoents not seen after package installation

Many thanks!
On Wed, 15 Dec 2004 22:17:19 -0800, Remy Lebeau (TeamB)
< XXXX@XXXXX.COM >wrote:
Quote
>namespace MyComps

Your namespace is wrong. I am assuming that you wrote it yourself
manually,
is that right?
Actually it is a Delphi package from which I am manually converting to BCB
one:
www.gsc.hu/
Quote
The 'C' must be 'c' instead. Only the first letter should
be capitalized, the rest must be all lowercase.
Having read your message, I changed it to
namespace Mycomps
just now but the components are still missing.
Quote
>Make and Install finishes with this message:
>
>Package c:\borland\cbuilder6\Projects\Bpl\PkgMyComps.bpl
>has been installed.

Your components were not installed. If they had been, the actual class
names would have been listed in that message.
Right! They are not installed. I saw those two class names shown up twice,
but never again since then.
Quote
Which suggests to me that your package is not actually set up properly
in the first place.
I have read the manual and tried creating this new package (.bpk) several
times in this way:
- choose "Package" from "File | New | Other"
- add all the needed .cpp files
- set some switches on Project Options
- make and install this project
Is there anything special I overlooked?
Regards,
CN
 

{smallsort}

Re:Compoents not seen after package installation

"CN" < XXXX@XXXXX.COM >wrote in message
Quote
Actually it is a Delphi package from which I am manually converting
to BCB one:
Namespaces derived from Delphi code already capitalized in the first letter
only.
Quote
www.gsc.hu/
Having read your message, I changed it to

namespace Mycomps

just now but the components are still missing.
Then please show your actual code. It is still not set up properly.
What is the name of the file? The namespace must match the filename, minus
the extension. In other words, since your namespace is Mycomps, the file
name must be MyComps.cpp.
Gambit
 

Re:Compoents not seen after package installation

Quote
>namespace Mycomps
...
What is the name of the file? The namespace must match the filename,
minus the extension. In other words, since your namespace is Mycomps,
the file
name must be MyComps.cpp.
I didn't know this! I thought they were arbitrary.
Amazing! The components have been successfully installed after these two
entities were tuned, according to your instructions of course, to match
with each other.
Many thanks for your patience and help!
Best regards,
CN
 

Re:Compoents not seen after package installation

"CN" < XXXX@XXXXX.COM >wrote in message
Quote
I didn't know this! I thought they were arbitrary.
Normally, they are. But not in the case of Register() specifically. The
IDE has to be able to locate Register() dynamically when the package is
loaded. There might be multiple exported Register() functions in a single
package. So the IDE enumerates the units of the package, taking the unit
names (aka the filenames) and translating them into namespaces, and then it
looks for exported Register() functions that belongs to each of those
namespaces.
Gambit
 

Re:Compoents not seen after package installation

Quote
Normally, they are. But not in the case of Register() specifically. The
IDE has to be able to locate Register() dynamically when the package is
loaded. There might be multiple exported Register() functions in a
single
package. So the IDE enumerates the units of the package, taking the unit
names (aka the filenames) and translating them into namespaces, and then
it
looks for exported Register() functions that belongs to each of those
namespaces.
Thank you for the detail!
Somewhat off topic - I am thinking that a warning from IDE about
installation failure caused by mismatched names would make programmers'
(maybe only myself :-)) lives more easy.
Regards,
CN