tags:

views:

135

answers:

1

I'm sure there's something simple I'm missing. I'm running from the Visual Studio Command Prompt.

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
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?
Not that I know. But why would you want to link explicitly to advapi32 if you do not use it ?
RaphaelSP
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.
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
... because it can cause deadlocks or crashes.
RaphaelSP