vb6 - "Declare" statement as yet an other way to circumvent the .dll hell? -


to astonishment found vb6 code uses declare statements define functions in .dll lives in program folder without being registered on windows. seems supersimple way avoid .dll hell without having resort using side side manifests. can read more somewhere? there snags?

the declare statement used "just in time" binding non-activex dlls. until program "touches" declared entrypoint no attempt made load library.

it has nothing @ topic of dll hell.

muddled thinking can lead people plop activex dlls "next to" exe can result in dll hell because people tend use poor techniques installing , uninstalling applications.

  1. poorly designed application deployment plops commonly shared dll or ocx next exe.
  2. poorly designed application run, vb6 runtime can't find classes in registry, dll search using windows heuristics, locates dll next exe , calls self-registration entrypoint.
  3. innocent, designed applications b, c, d later installed use same dll/ocx , installers find library registered.
  4. poorly designed application uninstalled, typically deleteing folder in program files.
  5. applications b, c, , d (and future applications using library) broken - due orphaned component registration pointing non-existant library.

moral of story:

never, never, never put dlls "next to" vb6 application on installation. if have private dlls not shared other applications even then put them libs, etc. folder under application folder. possible exception might non-com dlls, such expect use declare with.

there great deal of misunderstanding manifests, of there multiple kinds. ones thinking of application , assembly manifests.

these can used selecting among different versions of library installed side side, or can used isolate applications , assemblies part has bearing on dll hell.

of course application manifests can used specify quite few other things how windows should run application.


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -