A worked example of using manifests to create side-by-side assembles to allow a single process to use two disparate versions of the same DLL.
Main application executable::
- MyApp.c:
MyApp.exe.manifest:
- MyDll.c::
Mydll.dll.manifest:
- Dep.c:
Dep.dll.manifest:
Extension dll:
- Ext\ExtDll.c:
Ext\ExtDll.manifest:
- Ext\Dep.c:
ext\Dep.dll.manifest:
Build:
C:\test\myApp\Ext>cl /nologo /LD Dep.c Dep.c Creating library Dep.lib and object Dep.exp C:\test\myApp\Ext>mt /nologo -manifest Dep.dll.manifest -outputresourc +e:Dep.dll;2 C:\test\myApp\Ext>cl /nologo /LD ExtDll.c Dep.lib ExtDll.c Creating library ExtDll.lib and object ExtDll.exp C:\test\myApp\Ext>mt /nologo -manifest ExtDll.dll.manifest -outputreso +urce:ExtDll.dll;2 C:\test\myApp\Ext>cd .. C:\test\myApp>cl /nologo /LD Dep.c Dep.c Creating library Dep.lib and object Dep.exp C:\test\myApp>mt /nologo -manifest Dep.dll.manifest -outputresource:De +p.dll;2 C:\test\myApp>cl /nologo /LD myDll.c Dep.lib myDll.c Creating library myDll.lib and object myDll.exp C:\test\myApp>mt /nologo -manifest MyDll.dll.manifest -outputresource: +MyDll.dll;2 C:\test\myApp>cl /nologo myApp.c MyDll.lib myApp.c C:\test\myApp>mt /nologo -manifest MyApp.exe.manifest -outputresource: +MyApp.Exe;1
And a run:
C:\test\myApp>MyApp.Exe Ext\ExtDll.dll depFunc: called with 42, 3.141593 MyDLL: depFunc return 1 depFunc: called with 12345, 98765 ExtDll: depFunc returned: 1
And there you have it. One executable using two different versions of the same (named) dll without conflict.
With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: [OT] Side-by-side assemblies: The nitty-gritty.
by Anonymous Monk on Sep 16, 2012 at 15:24 UTC | |
by BrowserUk (Patriarch) on Sep 16, 2012 at 15:46 UTC | |
by BrowserUk (Patriarch) on Sep 17, 2012 at 16:16 UTC | |
Re: [OT] Side-by-side assemblies: The nitty-gritty.
by sundialsvc4 (Abbot) on Sep 18, 2012 at 19:17 UTC | |
by BrowserUk (Patriarch) on Sep 18, 2012 at 20:05 UTC |
Back to
Meditations