"George" <George@discussions.microsoft.com> wrote in message
news:5CA28152-9BE7-45A4-8F67-20DA96A6A307@microsoft.com...
CRT is implemented a way that if developer provides DllMain, it
will use the
provided one, or else the default DllMain is used.
I am wondering how to implement similar selective linking approach?
i.e. if
there are more than one implementations of a method of the same
signature, I
can control which one has the higher priority to link, and if the
highest priority one does not exist, the second priority one will
be used (and compiler will have no duplicated method warning/error).
Here is what I'm sure of: The CRT has a source file named Dllmain.c.
The comments say it is used when no other version is provided.
Here is what I'm not sure of: I think that it is a simple matter
specifying Dllmain.obj on the linker command line but _after_ all of
the other object modules and libraries. If the reference is resolved
early, the CRT's Dllmain won't be linked. If not, it will
Regards,
Will