Author | Topic: Difference between Static and dynamic DLL? | |
---|---|---|
Klemens Lichter | Difference between Static and dynamic DLL? on Sat, 03 Jan 2004 14:17:11 +0100 Hi, want first time try to place some source into a DLL. VX offers me static and dynamical dlls, but nowhere in the DOCs I find a description what the difference is between tose two. Especially Im interested to know if there are certain things to place better in static dll or in dynamical dll? What about resources? Better in static or dynamical? Klemens | |
James Loughner | Re: Difference between Static and dynamic DLL? on Sat, 03 Jan 2004 10:13:47 -0500 STATIC - Staticly linked DLLs are loosly like the old CLiper library files. They are physicly linked to the exe and the exe loads them automticly at runtime. All code in the DLL can be treated as if it was in the exe. DYNAMIC - Dyanmicly linked DLLs are manualy loaded by you when your code needs those functions in the DLL. see DllLoad and DllCall functions. you must use either DllCall() or a micro &(<cFuncName>) ( [<xParam,...>] ) to call the functions in a dynamic DLL. Jim Klemens Lichter wrote: > Hi, > want first time try to place some source into a DLL. VX offers me static and > dynamical dlls, but nowhere in the DOCs I find a description what the > difference is between tose two. Especially I´m interested to know if there > are certain things to place better in static dll or in dynamical dll? What > about resources? Better in static or dynamical? > Klemens > > | |
Klemens Lichter | Re: Difference between Static and dynamic DLL? on Sat, 03 Jan 2004 17:35:23 +0100 Hi Jim, this I understand. But I dont undestand why VX defaults to "Static DLL" if I right click on my project within projectmanager and choose "add new target". So it would better default to "Dynamic DLL". Klemens "James Loughner" <jwrl@charter.net> schrieb im Newsbeitrag news:oARPrxg0DHA.2016@S15147418... STATIC - Staticly linked DLLs are loosly like the old CLiper library files. They are physicly linked to the exe and the exe loads them automticly at runtime. All code in the DLL can be treated as if it was in the exe. DYNAMIC - Dyanmicly linked DLLs are manualy loaded by you when your code needs those functions in the DLL. see DllLoad and DllCall functions. you must use either DllCall() or a micro &(<cFuncName>) ( [<xParam,...>] ) to call the functions in a dynamic DLL. Jim Klemens Lichter wrote: > Hi, > want first time try to place some source into a DLL. VX offers me static and > dynamical dlls, but nowhere in the DOCs I find a description what the > difference is between tose two. Especially Im interested to know if there > are certain things to place better in static dll or in dynamical dll? What > about resources? Better in static or dynamical? > Klemens > > | |
Joe Carrick - The Maniacc | Re: Difference between Static and dynamic DLL? on Sat, 03 Jan 2004 10:42:18 -0800 Hi Klemens, This is a good question, but I would think the default would be "Win32 App". "Static DLL" makes sense if you are adding a new target to an App. OTOH, if you are starting a new project, it seems you would either want to add a "Win32 App" or a "Dynamic DLL". I guess it's just a matter of preference. -Joe "Klemens Lichter" <csl@lichter.de> wrote in message news:pIzrcch0DHA.2012@S15147418... > Hi Jim, > this I understand. But I dont undestand why VX defaults to "Static DLL" if > I right click on my project within projectmanager and choose "add new > target". So it would better default to "Dynamic DLL". > Klemens > > "James Loughner" <jwrl@charter.net> schrieb im Newsbeitrag > news:oARPrxg0DHA.2016@S15147418... > > > STATIC - Staticly linked DLLs are loosly like the old CLiper library > files. They are physicly linked to the exe and the exe loads them > automticly at runtime. All code in the DLL can be treated as if it was > in the exe. > > DYNAMIC - Dyanmicly linked DLLs are manualy loaded by you when your code > needs those functions in the DLL. see DllLoad and DllCall functions. you > must use either DllCall() or a micro &(<cFuncName>) ( [<xParam,...>] ) > to call the functions in a dynamic DLL. > > > > Jim > > > Klemens Lichter wrote: > > Hi, > > want first time try to place some source into a DLL. VX offers me static > and > > dynamical dlls, but nowhere in the DOCs I find a description what the > > difference is between tose two. Especially Im interested to know if there > > are certain things to place better in static dll or in dynamical dll? What > > about resources? Better in static or dynamical? > > Klemens > > > > > > | |
Mike Evans | Re: Difference between Static and dynamic DLL? on Sat, 03 Jan 2004 21:03:20 +0200 If you want to change the order and the default type of project (or you want to add your own) then inside the BIN directory of Xbase++ there is a templates.ini file. If you open it and change the order of the Target "group" you can change the order and the default value. Regards Mike Evans "Joe Carrick - The Maniacc" <joe.carrick@dslextreme.com> wrote in message news:q1VpYli0DHA.2016@S15147418... > Hi Klemens, > > This is a good question, but I would think the default would be "Win32 App". > "Static DLL" makes sense if you are adding a new target to an App. OTOH, if > you are starting a new project, it seems you would either want to add a > "Win32 App" or a "Dynamic DLL". > > I guess it's just a matter of preference. > > -Joe > > "Klemens Lichter" <csl@lichter.de> wrote in message > news:pIzrcch0DHA.2012@S15147418... > > Hi Jim, > > this I understand. But I dont undestand why VX defaults to "Static DLL" > if > > I right click on my project within projectmanager and choose "add new > > target". So it would better default to "Dynamic DLL". > > Klemens > > > > "James Loughner" <jwrl@charter.net> schrieb im Newsbeitrag > > news:oARPrxg0DHA.2016@S15147418... > > > > > > STATIC - Staticly linked DLLs are loosly like the old CLiper library > > files. They are physicly linked to the exe and the exe loads them > > automticly at runtime. All code in the DLL can be treated as if it was > > in the exe. > > > > DYNAMIC - Dyanmicly linked DLLs are manualy loaded by you when your code > > needs those functions in the DLL. see DllLoad and DllCall functions. you > > must use either DllCall() or a micro &(<cFuncName>) ( [<xParam,...>] ) > > to call the functions in a dynamic DLL. > > > > > > > > Jim > > > > > > Klemens Lichter wrote: > > > Hi, > > > want first time try to place some source into a DLL. VX offers me static > > and > > > dynamical dlls, but nowhere in the DOCs I find a description what the > > > difference is between tose two. Especially Im interested to know if > there > > > are certain things to place better in static dll or in dynamical dll? > What > > > about resources? Better in static or dynamical? > > > Klemens > > > > > > > > > > > > | |
Andreas Herdt | Re: Difference between Static and dynamic DLL? on Mon, 05 Jan 2004 11:58:33 +0100 Mike Evans wrote: > If you want to change the order and the default type of project (or you want to add your own) then inside the BIN directory of > Xbase++ there is a templates.ini file. If you open it and change the order of the Target "group" you can change the order and the > default value. > > Regards > Mike Evans This is exactly the place where the template stuff can be customized. You can even add own templates to your installation. Edit Templates.ini accordingly and create a new directory in ..\Templates directory with the desired project. Unfortunately the template mechanism did not make it to the PreRelease. Regards Andreas Herdt [Alaska Research & Development] > "Joe Carrick - The Maniacc" <joe.carrick@dslextreme.com> wrote in message news:q1VpYli0DHA.2016@S15147418... > >>Hi Klemens, >> >>This is a good question, but I would think the default would be "Win32 App". >>"Static DLL" makes sense if you are adding a new target to an App. OTOH, if >>you are starting a new project, it seems you would either want to add a >>"Win32 App" or a "Dynamic DLL". >> >>I guess it's just a matter of preference. >> >>-Joe >> >>"Klemens Lichter" <csl@lichter.de> wrote in message >>news:pIzrcch0DHA.2012@S15147418... >> >>>Hi Jim, >>>this I understand. But I don´t undestand why VX defaults to "Static DLL" >> >>if >> >>>I right click on my project within projectmanager and choose "add new >>>target". So it would better default to "Dynamic DLL". >>>Klemens >>> >>>"James Loughner" <jwrl@charter.net> schrieb im Newsbeitrag >>>news:oARPrxg0DHA.2016@S15147418... >>> >>> >>>STATIC - Staticly linked DLLs are loosly like the old CLiper library >>>files. They are physicly linked to the exe and the exe loads them >>>automticly at runtime. All code in the DLL can be treated as if it was >>>in the exe. >>> >>>DYNAMIC - Dyanmicly linked DLLs are manualy loaded by you when your code >>>needs those functions in the DLL. see DllLoad and DllCall functions. you >>>must use either DllCall() or a micro &(<cFuncName>) ( [<xParam,...>] ) >>>to call the functions in a dynamic DLL. >>> >>> >>> >>>Jim >>> >>> >>>Klemens Lichter wrote: >>> >>>>Hi, >>>>want first time try to place some source into a DLL. VX offers me static >>> >>>and >>> >>>>dynamical dlls, but nowhere in the DOCs I find a description what the >>>>difference is between tose two. Especially I´m interested to know if >> >>there >> >>>>are certain things to place better in static dll or in dynamical dll? >> >>What >> >>>>about resources? Better in static or dynamical? >>>>Klemens >>>> >>>> >>> >>> >> > > | |
Andreas Herdt | Re: Difference between Static and dynamic DLL? on Mon, 05 Jan 2004 11:53:52 +0100 Klemens Lichter wrote: > Hi Jim, > this I understand. But I don´t undestand why VX defaults to "Static DLL" if > I right click on my project within projectmanager and choose "add new > target". So it would better default to "Dynamic DLL". > Klemens There is nothing to understand here. VX has to use a default. But you are right. Static Dll is an unintelligent default. Regards Andreas Herdt [Alaska Research & Development] > "James Loughner" <jwrl@charter.net> schrieb im Newsbeitrag > news:oARPrxg0DHA.2016@S15147418... > > > STATIC - Staticly linked DLLs are loosly like the old CLiper library > files. They are physicly linked to the exe and the exe loads them > automticly at runtime. All code in the DLL can be treated as if it was > in the exe. > > DYNAMIC - Dyanmicly linked DLLs are manualy loaded by you when your code > needs those functions in the DLL. see DllLoad and DllCall functions. you > must use either DllCall() or a micro &(<cFuncName>) ( [<xParam,...>] ) > to call the functions in a dynamic DLL. > > > > Jim > > > Klemens Lichter wrote: > >>Hi, >>want first time try to place some source into a DLL. VX offers me static > > and > >>dynamical dlls, but nowhere in the DOCs I find a description what the >>difference is between tose two. Especially I´m interested to know if there >>are certain things to place better in static dll or in dynamical dll? What >>about resources? Better in static or dynamical? >>Klemens >> >> > > > | |
Andreas Herdt | Re: Difference between Static and dynamic DLL? on Mon, 05 Jan 2004 11:50:17 +0100 Klemens Lichter wrote: > Hi, > want first time try to place some source into a DLL. VX offers me static and > dynamical dlls, but nowhere in the DOCs I find a description what the > difference is between tose two. Static: Objs are created with compile flag /DLL Dynamic: Objs are created with compile flag /DLL:dynamic The resulting Dlls can be statically linked to a target #pragma Library ( "mydll.lib" ) and dynamically loaded at runtime DllLoad() The difference is that - a static dll can not be unloaded with DllUnload() again since the required code for cleanup is not emitted by the compiler. - a dynamic dll is slightly slower due to more overhead. Attention: A dynamic dll can not be unloaded if it is linked against a static dll. > Especially I´m interested to know if there > are certain things to place better in static dll or in dynamical dll? > What about resources? Better in static or dynamical? Depends on what you want. If you like to change code at runtime you must use dynamic dlls for example. Regards Andreas Herdt |