[EMAIL PROTECTED] wrote: >> reynaldi81 wrote: >>> i keep getting this error message when trying to unload preloaded >>> package. "Exception EAccessViolation in module rtl70.bpl at 00008EEC". >>> does anyone know what might caused this problem? >> >> What is a "preloaded" package? How do you load it? How do you unload it? > > My understanding is that a preloaded package is one specified in the > project options (Packages tab Delphi 5). > > Delphi will load these with your EXE at startup. So if they are not in the > current directory or on the path startup fails.
The term for that is "load-time dynamic linking." The other term frequently used for that in the Delphi world is "static linking" (but it's not called that in the rest of the Windows world since the linking is not static at all). It's not Delphi that loads the packages. It's the operating system that loads them before any application code ever runs. Reynaldi, can you please confirm that this is what you're talking about? > Never tried to unload one, the idea is that they are global to the app > (otherwise why preload them?). Not sure how you could unload it, unless > you can find the handle Delphi got when it pre-loaded it. Delphi doesn't receive a handle. It's easy to get a handle to a loaded package, though. Use GetModuleHandle. Packages aren't any different from normal DLLs, in that respect. > Compare to "not preloaded", meaning you did it yourself inside your > program using the LoadPackage routine... and can therefore unload it > whenever you want by passing the handle to UnloadPackage. The prefix "pre" implies that the loading is happening before something else, but we've never been told what that "something else" is. -- Rob

