Re: Control panel applet question
* Sam Hobbs:
"Alf P. Steinbach" <alfps@start.no> wrote in message
news:YvSdnS53F7ELvRPVnZ2dnUVZ_qPinZ2d@posted.comnet...
* Sam Hobbs:
"Dean Earley" <dean.earley@icode.co.uk> wrote in message
news:eZ2Gvsx5IHA.3420@TK2MSFTNGP05.phx.gbl...
Tim Roberts wrote:
Dean Earley <dean.earley@icode.co.uk> wrote:
Polaris wrote:
Hi Experts:
I have a control panel applete (testApplet.cpl) which is statically
linked to a dll (test.dll). My questions are:
1. Can I put testApplet.cpl at locations other than System32
directory?
2. If I have to put testApplet.cpl in System32 directory, is there a
way for me to put test.dll in locations other than System32
directory? For example, I prefer to put test.dll in my application
folder under "Program Files".
If it is statically linked to test.dll, you don't need to put it
anywhere on the target system.
You can't statically link to a DLL, at least in the way you mean.
What Polaris meant was statically linking to the export library for
test.dll. It will still be a dynamic link, and test.dll will still be
required at run-time.
Ah yes, sorry. I blame lunacy :)
I blame terminology. It is a contradiction in terms to say "statically
linked to a dll" since a dll is by definition "dynamically linked".
Well there's a difference between statically linking to the DLL, where the
dynamic linking is performed by the OS loader, and dynamically loading the
DLL by calling LoadLibrary or friend.
Wrong. I avoid saying "wrong" but I don't know how to emphasize the error
here. What you are describing is implicit and explicit linking. Implicit
linking is where the linker uses a lib file and then during execution the
dll is located by Windows without requiring us to specify the dll file in
our code. Explicit linking uses LoadLibrary with the dll file name as a
parameter in our code.
Please note that it's not necessary to use a lib file (import library) to link
to a DLL, except with Microsoft's current tools.
In the old days we used module definition files. GNU tools still don't require
an import library. Import libraries are tool functionality.
I'm sorry if you feel the terminology to be wrong. But it exists. :-) And one
might make a case that using LoadLibrary explicitly is not linking at all; it
isn't usually referred to as linking (except perhaps by Microsoft doc ;-) ).
I don't understand what "statically linked to a dll" means. Perhaps the
correct term is "implicitly linked".
Statically linked probably means the opposite of dynamically loaded. :-)
No, static linking means that the linker puts the code in the exe so that
the code is a permanent part of the exe. Note that it is called static and
dynamic linking, not loading. DLL means "Dynamic Link Library". I am sorry
for saying I don't understand what "statically linked to a dll" means. I was
tring to be nice in my explanation.
Back in the days of DOS, a lib (library) file was only capable of storing
object (obj) files; the equivalent of a static library. An object file is
the output of a compiler. Windows created dynamic link libraries and defined
a format for lib files so the link editor can create an exe that could load
DLLs implicitly.
Uhm, I'm absolutely not sure that Windows defined the COFF format, if that's
what you're hinting at here. Checking... Nope, the COFF format originated with
Unix (System V).
Cheers, & hth.,
- Alf
--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?