3

How can I load a DLL only when it's needed?

I have a program that I set some dependecies (through Properties > Linker > Input > Additional Dependencias). But the executable cannot run without this dependecies. How can I create a windows application that only require this DLL when it's needed?

Victor
  • 8,309
  • 14
  • 80
  • 129

1 Answers1

5

You can load the DLL "manually" using LoadLibrary and use GetProcAddress to resolve all the symbols. However doing it that way, it's your responsibility to make sure everything is properly loaded and resolved, before any symbols (functions) of the DLL are used.

datenwolf
  • 159,371
  • 13
  • 185
  • 298