Solved

My runtime packages (and error U931)

Posted on 2001-08-08
11
354 Views
Last Modified: 2010-04-06
I created long ago some packages for design-time. One of them incidentally (let's call it mylow.dpk) didn't have anything to register and other one (let's call it mycomp.dpk) did have some components. There is at least one other package (let's call it super.dpk) that has components and uses mycomp.dpk.

Now I want to switch to runtime libs.

First step: I check runtime libs and I delete all stuff in the RTlibs except for the VCL, VCLDB and so. It compiles OK, it runs OK, the EXE is significantly smaller.

Step2: I add to the list of RTlibs the package mylow.dpk (I'm using units from that in the project). It compiles again OK; all is OK.

Step3: I add to that list the package mycomp. Project compiles OK, but after compilation ends Delphi unloads super.dpl saying that something needed is missing. After that I start getting randomly Internal Error U931 on compiling.

The size of the mycomp.dpl created with Project build is significantly smaller than the size obtained when compiling the package directly.

Bottom line: How can I create runtime packages of my own, containing design-time components, too, besides the packages coming from Borland?

It's D3 CS. Please do not tell me to call tech support on that U931 error.

If I didn't manage to be clear enough, please ask for more detail or even for a rephrase of the question.

F.
0
Comment
Question by:fva
11 Comments
 
LVL 21

Expert Comment

by:gemarti
Comment Utility
Have you looked at the help file on generating runtime packages.?

Maybe you need to do this?

The {$RUNONLY ON} directive causes the package where it occurs to be compiled as runtime only. Packages compiled with {$RUNONLY ON} cannot be installed as design-time packages in the Delphi IDE.
Place the RUNONLY directive only in .DPK files. For more information, see the Object Pascal Language Guide.
0
 
LVL 4

Author Comment

by:fva
Comment Utility
Actually I did read the Help, even if one can never claim it had been reading the Help enough :)

Well, my packages have both checkboxes set, and that means neither RUNONLY nor DESIGNONLY are included in the DPK. Nevertheless, I tried all combinations of settings.

I feel there's a big "catchy" issue missing from the Help but I cannot pinpoint it.

F.
0
 
LVL 21

Expert Comment

by:gemarti
Comment Utility
At step 2 you added Mylow.dpk and all ran fine after compilation. Right?

Then at step 3 you added MyComp.dpk compiled and ran, but you started getting errors (U931)? Right?

You never actually add Super.bpl to the new package right?

What is in your uses clause for the Super.bpl? Did you remove a package that super.bpl uses to work?

I think you've removed something from the copiliation that the package library needs.
0
 
LVL 21

Expert Comment

by:gemarti
Comment Utility
What's in the uses clause for MyComp units?
0
 
LVL 4

Author Comment

by:fva
Comment Utility
No, it's not about a new package. It's about a project that I want to convert to runtime packages.
The project uses all three (mylow,mycomp and super).
No action was taken against super. It used and still uses (read require) mylow and mycomp.

Mycomp compiles OK requiring mylow, vcl30 and vcldb30.

F.
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 2

Expert Comment

by:Felixin
Comment Utility
Which version of Delphi are you using now?
0
 
LVL 4

Author Comment

by:fva
Comment Utility
D3 C/S.
0
 
LVL 21

Accepted Solution

by:
gemarti earned 25 total points
Comment Utility
"but after compilation ends Delphi
unloads super.dpl saying that something needed is missing. "

I think that you are trying to use someing in super.bpl that isn't availabe..... That is why I suggest looking at the uses clause in the units of super.bpl.


It is the only explaination I can think of.
0
 
LVL 4

Author Comment

by:fva
Comment Utility
Well, after a few days of thinking about it I found the "cure" and the explanation for it. Here it is:

When I compile/build a package using the package IDE interface, the package is built with all references included, i.e. as a project with _no) runtime libs. This enables the package to be loaded successfully by IDE because the IDE knows the full path to the package and it needs nothing more.
When the package is automatically built within a project build session that uses runtime libs, the package itself is compiled with runtime libs (that's why the packages were getting smaller). The compiler is happy with that, but the IDE obviously unloads those libraries for the duration of the compilation and wants to load them back again once the compilation is done. This is where the problem occurs, because the package "super" will need "mycomp.dpl" _in_the_system_path_ as any other DLL. Since mycomp.dpl is not in the system path, super.dpl fails when the IDE tries to load it. That's it.
I made a copy to mycomp.dpl in Windows dir (which _is_ in the system path) and the error dissapeared. Of course, this is not the final solution, since after that the mycomp copy loaded by IDE is the one in Windows dir, not the last compiled one, but at least I see the light.
I'm facing a huge package restructuration, combined with some path reconfiguration, but I'm pretty sure it'll solve my problems.

Thank you all who showed up in this thread.

F.
0
 
LVL 3

Expert Comment

by:modder
Comment Utility
Points reduced to 25 as requested in http://www.experts-exchange.com/jsp/qShow.jsp?ta=commspt&qid=20167422

modder
Community Support
0
 
LVL 4

Author Comment

by:fva
Comment Utility
Thank you gemarti for bothering with this question. I'll award these 25 pts to you for that.

F.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

744 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now