I'm sure there's something simple I'm missing. I'm running from the Visual Studio Command Prompt.
views:
135answers:
1
A:
By linking with the right import library.
Add advapi32.lib to the command line, cl.exe should recognize it as a library to link to.
RaphaelSP
2009-07-20 19:16:14
Thanks. After doing that Depends.exe still shows it as a delay-load library. Is there any way to force it to load and initialize apart from calling a function in it?
2009-07-20 19:35:31
Not that I know. But why would you want to link explicitly to advapi32 if you do not use it ?
RaphaelSP
2009-07-20 19:51:47
I'm trying to work around a bug caused by calling it from within dllMain. It's not initialized properly yet so it is failing.
2009-07-20 19:54:46
Well, generally speaking, you should not use delay-loaded libraries or LoadLibrary them from DllMain (see http://www.microsoft.com/whdc/driver/kernel/DLL_bestprac.mspx).
RaphaelSP
2009-07-20 19:57:24
... because it can cause deadlocks or crashes.
RaphaelSP
2009-07-20 20:00:42