1

I downloaded a source code form a website and it contains the main.cpp and a folder with some .dll files. In the main.cpp file there are includes to headers with similar names to the .dll files. Is there any way I can use the source code in a VS project with only the .dll files even if I have not the headers?

Ulrich Eckhardt
  • 16,572
  • 3
  • 28
  • 55
tigeradol
  • 259
  • 2
  • 16

1 Answers1

2

To answer your question, yes you can do that. Just load a DLL using the LoadLibrary() function and resolve functions from it with GetProcAddress(), aka "explicit loading". However, this requires knowledge of the interface that the DLL exports, which is equivalent to the information provided by the headers that you don't have. If you had the information, you could also write the headers, if you don't, you can't load the DLL. Note that to some extent, tools like dependencywalker can determine the DLL's interface, but that may or may not be enough to use it. In summary, no, you can't do that, you need to know the interface.

Ulrich Eckhardt
  • 16,572
  • 3
  • 28
  • 55