[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

install package -> device not functioning !!!

Posted on 1999-11-23
11
Medium Priority
?
234 Views
Last Modified: 2012-05-04
I'm developing a component package (Delphi 4). All is going well and I managed to install it in the IDE and use the components in a test app. Editing the components and re-building + re-installing also works fine.

This morning I started Delphi and got the following message:

can't load package xxx.bpl  
a device attached to your system is not functioning

(xxx = name of package)
I get the same message if I try re-install it after re-building.

According to the device manager of my computer, all devices work alright. I don't see any malfunctioning of my computer. Resources are not abundant, but nothing critical, as far as I can see.

What is wrong?

Wim
0
Comment
Question by:cadenza
  • 5
  • 5
11 Comments
 
LVL 10

Expert Comment

by:Lischke
ID: 2227820
Hi cadenza,

I too had a hard time with this kind of error message. I don't know if it applies here, but I have developed a control with Delphi 3.02 and every time another programmer which only had 3.0 or 3.01 installed got the said message.

The reason was that the control made calls to functions in packages which weren't there in earlier versions. Could that be the same reason in your case? My solution was to uncheck the "Build with runtime packages" check box in the package options. This compiled all necessary code directly into the control and it doesn't need to rely on existing dpls/bpls anymore.

Ciao, Mike
0
 

Author Comment

by:cadenza
ID: 2228325
Hi Mike,

1) at the moment I am the only one who is working on this. The package has not yet seen any other hardware. All the time I have used 4.03.

2) runtime packages were unchecked. Checking/unchecking makes no difference for this problem

The fact that you had the same message under different circumstances and the mismatch between your real problem and the message confirm my earlier thoughts: this probably is a 'catch all' message and tells nothing about the real problem.

thanks for your feed back !

Wim
0
 
LVL 10

Expert Comment

by:Lischke
ID: 2228445
I agree. The message had really nothing to do with the true problem and I assume this is here also the case...

Try making full rebuild of all custom packages and try creating stuff from the package in question at runtime. Does it come up with the same or an other error?

Ciao, Mike
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:cadenza
ID: 2228624
Hi Mike,

in the mean time I did some further experiments. The package contains 4 components. The problem is connected to only one of them. If I delete it from the package, all goes well. The component in question works alright if created 'manually' at runtime. I tried to corner the problem by commenting out pieces of code, but have not been able to find anything. The only thing so far was that if I comment everything out except something like:

TMyClass = class(ParentClass)
private
end;

the package containing this 'component' installs without problem. boohooo :(  

I'll go on trying, but if you have (or someone else has) a solution or any idea that shortens this waste of time, I will be glad to give the points.

Wim
0
 
LVL 10

Expert Comment

by:Lischke
ID: 2228786
Little tip: watch out for code which uses quite new stuff like special ComCtrl features, COM, TOM and such...

Ciao, Mike
0
 

Author Comment

by:cadenza
ID: 2228796
Hi again,

I found a solution. The component which caused the problem is a descendant of TCustomGrid. I override the (protected) DrawCell method. Since I do a lot with colour palettes and mapping of data that is not there during designtime, I test on designtime and if so, I call the inherited DrawCell and exit the method:

if csDesigning in ComponentState then begin
  inherited DrawCell(..arguments..);
  exit;
end;

if I comment out the line where the inherited method is called, everything goes fine and I can install the component.

If you know why, I would be glad to know.

Cheers,

Wim
0
 
LVL 10

Expert Comment

by:Lischke
ID: 2228943
:-) You should have posted the code you are executing now only at runtime. If it is too much then send it to public@lischke-online.de, otherwise post it here.

Ciao, Mike
0
 

Author Comment

by:cadenza
ID: 2229656
Well, actually I think the lines that really do matter were the lines I already posted.

WOAHH !!!

While typing in the rest of my answer (explaining why I am puzzled) I found the answer:

TCustomGrid.DrawCell is abstract!! Descendant classes must override it (which I did, ofcourse), but can not call the parent method. Stupid: My first go at this component was to inherit from TDrawGrid, which does have an implemented DrawCell. When switching to TCustomGrid I forgot about this detail. (strange the compiler does not catch this...)

Well Mike, thanks for listening. If you had not been there, asking questions, I would never have discovered this. Thanks again + the points are yours.

Cheers,

Wim
0
 
LVL 10

Accepted Solution

by:
Lischke earned 1000 total points
ID: 2230623
:-)) Yes, that's the way it is. I often found a problem by simply describing it to another guy...

Ciao, Mike
0
 
LVL 4

Expert Comment

by:maverick65
ID: 7299542
*** PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER ! ***

No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in Community Support that this question is:

<Recommendation>
   PAQ'd and pts removed
</Recommendation>

If anyone participating in the question disagrees with the recommendation,
please leave a comment for the mods within the next 7 days.

*** PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER ! ***

maverick
0
 

Author Comment

by:cadenza
ID: 7299970
I discovered that, other than my intentions, I still had not accepted Mike's comment as an answer. Sorry for that. I added interest as compensation :0)

cheerio,
Wim

0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Kernel Data Recovery is a renowned Data Recovery solution provider which offers wide range of softwares for both enterprise and home users with its cost-effective solutions. Let's have a quick overview of the journey and data recovery tools range he…
Suggested Courses
Course of the Month10 days, 7 hours left to enroll

612 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